diff --git a/.flake8 b/.flake8 index 01f5e77bdef..bb1ecb6fb4b 100644 --- a/.flake8 +++ b/.flake8 @@ -5,6 +5,8 @@ max-line-length = 120 # E501 is not flexible enough, we're using B950 instead ignore = E203,E305,E402,E501,E721,E741,F403,F405,F821,F841,F999,W503,W504,C408,E302,W291,E303, + # EXE001 is skipped for now because some files use shebang to determine Python version. + EXE001, # these ignores are from flake8-bugbear; please fix! B007,B008, # these ignores are from flake8-comprehensions; please fix! diff --git a/aten/src/ATen/native/cuda/PersistentSoftmax.cuh b/aten/src/ATen/native/cuda/PersistentSoftmax.cuh old mode 100755 new mode 100644 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6ba89e80f31..ad3bc587e82 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -31,6 +31,16 @@ jobs: versionSpec: "2.7" - script: (! git grep -I -l $'\t' -- . ':(exclude)*.svg' ':(exclude)**Makefile' ':(exclude)**/contrib/**' ':(exclude)third_party' ':(exclude).gitattributes' ':(exclude).gitmodules' || (echo "The above files have tabs; please convert them to spaces"; false)) +- job: ensure_not_executable + displayName: "Ensure C++ source files are not executable" + pool: + vmImage: 'Ubuntu 16.04' + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: "2.7" + - script: (! find . \( -path ./third_party -o -path ./.git -o -path ./torch/bin -o -path ./build \) -prune -o -type f -executable -regextype posix-egrep -not -regex '.+(\.(bash|sh|py|so)|git-pre-commit)$' -print | grep . || (echo 'The above files have executable permission; please remove their executable permission by using `chmod -x`'; false)) + - job: python_27_lint displayName: "Python 2.7 Lint" pool: @@ -52,7 +62,7 @@ jobs: - task: UsePythonVersion@0 inputs: versionSpec: "3.7" - - script: pip install flake8 flake8-bugbear flake8-mypy flake8-comprehensions flake8-pyi mccabe pycodestyle pyflakes + - script: pip install flake8 flake8-bugbear flake8-mypy flake8-comprehensions flake8-executable flake8-pyi mccabe pycodestyle pyflakes - script: flake8 1>&2 - job: mypy_typecheck diff --git a/binaries/convert_image_to_tensor.cc b/binaries/convert_image_to_tensor.cc old mode 100755 new mode 100644