Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

Commit 1b30e26

Browse files
committed
[Lint] Prohibit tabs in shell scripts
Fix current violations
1 parent 22d7be5 commit 1b30e26

File tree

8 files changed

+321
-26
lines changed

8 files changed

+321
-26
lines changed

.lintrunner.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,26 @@ init_command = [
1818
'ruff==0.1.1',
1919
]
2020
is_formatter = true
21+
22+
[[linter]]
23+
code = 'TABS'
24+
include_patterns = ['**/*.sh']
25+
exclude_patterns = [
26+
'**/*Makefile',
27+
'common/install_rocm_drm.sh',
28+
'.lintrunner.toml',
29+
]
30+
command = [
31+
'python3',
32+
'tools/linter/adapters/grep_linter.py',
33+
# @lint-ignore TXT2
34+
'--pattern= ',
35+
'--linter-name=TABS',
36+
'--error-name=saw some tabs',
37+
'--replace-pattern=s/\t/ /',
38+
"""--error-description=\
39+
This line has tabs; please replace them with spaces.\
40+
""",
41+
'--',
42+
'@{{PATHSFILE}}'
43+
]

common/install_cuda.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ while test $# -gt 0
146146
do
147147
case "$1" in
148148
11.8) install_118; prune_118
149-
;;
149+
;;
150150
12.1) install_121; prune_121
151-
;;
152-
*) echo "bad argument $1"; exit 1
153-
;;
151+
;;
152+
*) echo "bad argument $1"; exit 1
153+
;;
154154
esac
155155
shift
156156
done

conda/build_pytorch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ else
264264
# TODO, simplify after anaconda fixes their cudatoolkit versioning inconsistency.
265265
# see: https://github.com/conda-forge/conda-forge.github.io/issues/687#issuecomment-460086164
266266
if [[ "$desired_cuda" == "12.1" ]]; then
267-
export CONDA_CUDATOOLKIT_CONSTRAINT=" - pytorch-cuda >=12.1,<12.2 # [not osx]"
268-
export MAGMA_PACKAGE=" - magma-cuda121 # [not osx and not win]"
267+
export CONDA_CUDATOOLKIT_CONSTRAINT=" - pytorch-cuda >=12.1,<12.2 # [not osx]"
268+
export MAGMA_PACKAGE=" - magma-cuda121 # [not osx and not win]"
269269
elif [[ "$desired_cuda" == "11.8" ]]; then
270270
export CONDA_CUDATOOLKIT_CONSTRAINT=" - pytorch-cuda >=11.8,<11.9 # [not osx]"
271271
export MAGMA_PACKAGE=" - magma-cuda118 # [not osx and not win]"

conda/pytorch-nightly/build.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ if [[ -n "$build_with_cuda" ]]; then
5656
export USE_STATIC_CUDNN=1 # links cudnn statically (driven by tools/setup_helpers/cudnn.py)
5757

5858
if [[ $CUDA_VERSION == 11.8* ]]; then
59-
TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;3.7+PTX;9.0"
60-
#for cuda 11.8 we use cudnn 8.7
61-
#which does not have single static libcudnn_static.a deliverable to link with
62-
export USE_STATIC_CUDNN=0
63-
#for cuda 11.8 include all dynamic loading libraries
64-
DEPS_LIST=(/usr/local/cuda/lib64/libcudnn*.so.8 /usr/local/cuda-11.8/extras/CUPTI/lib64/libcupti.so.11.8)
59+
TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;3.7+PTX;9.0"
60+
#for cuda 11.8 we use cudnn 8.7
61+
#which does not have single static libcudnn_static.a deliverable to link with
62+
export USE_STATIC_CUDNN=0
63+
#for cuda 11.8 include all dynamic loading libraries
64+
DEPS_LIST=(/usr/local/cuda/lib64/libcudnn*.so.8 /usr/local/cuda-11.8/extras/CUPTI/lib64/libcupti.so.11.8)
6565
elif [[ $CUDA_VERSION == 12.1* ]]; then
66-
# cuda 12 does not support sm_3x
67-
TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;9.0"
68-
# for cuda 12.1 we use cudnn 8.8 and include all dynamic loading libraries
69-
export USE_STATIC_CUDNN=0
70-
DEPS_LIST=(/usr/local/cuda/lib64/libcudnn*.so.8 /usr/local/cuda-12.1/extras/CUPTI/lib64/libcupti.so.12)
66+
# cuda 12 does not support sm_3x
67+
TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST;9.0"
68+
# for cuda 12.1 we use cudnn 8.8 and include all dynamic loading libraries
69+
export USE_STATIC_CUDNN=0
70+
DEPS_LIST=(/usr/local/cuda/lib64/libcudnn*.so.8 /usr/local/cuda-12.1/extras/CUPTI/lib64/libcupti.so.12)
7171
fi
7272
if [[ -n "$OVERRIDE_TORCH_CUDA_ARCH_LIST" ]]; then
7373
TORCH_CUDA_ARCH_LIST="$OVERRIDE_TORCH_CUDA_ARCH_LIST"

ffmpeg/recipe/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fi
2323
--disable-static \
2424
--enable-version3 \
2525
--enable-zlib \
26-
--enable-libmp3lame
26+
--enable-libmp3lame
2727

2828
make -j${CPU_COUNT}
2929
make install -j${CPU_COUNT}

manywheel/build_rocm.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ ROCM_SO_FILES=(
8888
"librccl.so"
8989
"librocblas.so"
9090
"librocfft.so"
91-
"librocm_smi64.so"
91+
"librocm_smi64.so"
9292
"librocrand.so"
9393
"librocsolver.so"
9494
"librocsparse.so"
@@ -128,7 +128,7 @@ elif [[ "$OS_NAME" == *"Ubuntu"* ]]; then
128128
LIBTINFO_PATH="/lib/x86_64-linux-gnu/libtinfo.so.6"
129129
else
130130
LIBTINFO_PATH="/lib/x86_64-linux-gnu/libtinfo.so.5"
131-
fi
131+
fi
132132
LIBDRM_PATH="/usr/lib/x86_64-linux-gnu/libdrm.so.2"
133133
LIBDRM_AMDGPU_PATH="/usr/lib/x86_64-linux-gnu/libdrm_amdgpu.so.1"
134134
MAYBE_LIB64=lib
@@ -170,8 +170,8 @@ do
170170
file_path=($(find $ROCM_HOME/ -name "$lib")) # Then search in ROCM_HOME
171171
fi
172172
if [[ -z $file_path ]]; then
173-
echo "Error: Library file $lib is not found." >&2
174-
exit 1
173+
echo "Error: Library file $lib is not found." >&2
174+
exit 1
175175
fi
176176
ROCM_SO_PATHS[${#ROCM_SO_PATHS[@]}]="$file_path" # Append lib to array
177177
done

manywheel/conda_build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if ! ls /usr/local/cuda-7.5
88
then
99
echo "Downloading CUDA 7.5"
1010
wget -c http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run \
11-
-O /remote/cuda_7.5.18_linux.run
11+
-O /remote/cuda_7.5.18_linux.run
1212

1313
echo "Installing CUDA 7.5"
1414
chmod +x /remote/cuda_7.5.18_linux.run
@@ -23,7 +23,7 @@ if ! ls /usr/local/cuda-8.0
2323
then
2424
echo "Downloading CUDA 8.0"
2525
wget -c https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run \
26-
-O /remote/cuda_8.0.61_linux-run
26+
-O /remote/cuda_8.0.61_linux-run
2727

2828
echo "Installing CUDA 8.0"
2929
chmod +x /remote/cuda_8.0.61_linux-run
@@ -39,7 +39,7 @@ if ! ls /usr/local/cuda-7.5/lib64/libcudnn.so.6.0.21
3939
then
4040
rm -rf /tmp/cuda
4141
wget -c http://developer.download.nvidia.com/compute/redist/cudnn/v6.0/cudnn-7.5-linux-x64-v6.0.tgz \
42-
-O /remote/cudnn-7.5-linux-x64-v6.0.tgz
42+
-O /remote/cudnn-7.5-linux-x64-v6.0.tgz
4343
pushd /tmp
4444
tar -xvf /remote/cudnn-7.5-linux-x64-v6.0.tgz
4545
cp -P /tmp/cuda/include/* /usr/local/cuda-7.5/include/
@@ -51,7 +51,7 @@ if ! ls /usr/local/cuda-8.0/lib64/libcudnn.so.6.0.21
5151
then
5252
rm -rf /tmp/cuda
5353
wget -c http://developer.download.nvidia.com/compute/redist/cudnn/v6.0/cudnn-8.0-linux-x64-v6.0.tgz \
54-
-O /remote/cudnn-8.0-linux-x64-v6.0.tgz
54+
-O /remote/cudnn-8.0-linux-x64-v6.0.tgz
5555
pushd /tmp
5656
tar -xvf /remote/cudnn-8.0-linux-x64-v6.0.tgz
5757
cp -P /tmp/cuda/include/* /usr/local/cuda-8.0/include/

0 commit comments

Comments
 (0)