Enable EXE001 flake8 check. (#27560)

Summary:
According to https://github.com/pytorch/pytorch/issues/27285 , seems we do not intend to use shebang as an indication of Python version, thus
we enable EXE001 flake8 check.
For violations, we either remove shebang from non-executable Python scripts or grant them executable permission.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/27560

Differential Revision: D17831782

Pulled By: ezyang

fbshipit-source-id: 6282fd3617b25676a6d959af0d318faf05c09b26
This commit is contained in:
Hong Xu 2019-10-09 09:03:37 -07:00 committed by Facebook Github Bot
parent 65cdc8db5d
commit 987e37b9c2
24 changed files with 1 additions and 33 deletions

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
This module models the tree of configuration variants
for "smoketest" builds.

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from collections import OrderedDict
import cimodel.data.binary_build_data as binary_build_data

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from cimodel.lib.conf_tree import ConfigNode, X, XImportant
from cimodel.lib.conf_tree import Ver

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from collections import OrderedDict
import cimodel.data.dimensions as dimensions

View file

@ -1,6 +1,3 @@
#!/usr/bin/env python3
PHASES = ["build", "test"]
CUDA_VERSIONS = [

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from cimodel.lib.conf_tree import ConfigNode, X, XImportant

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from collections import OrderedDict
from cimodel.data.pytorch_build_data import TopLevelNode, CONFIG_TREE_DATA

View file

@ -1,6 +1,3 @@
#!/usr/bin/env python3
from dataclasses import dataclass, field
from typing import Optional, Dict

View file

@ -1,6 +1,3 @@
#!/usr/bin/env python3
def quote(s):
return sandwich('"', s)

View file

@ -1,6 +1,3 @@
#!/usr/bin/env python3
from collections import OrderedDict

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""
This module encapsulates dependencies on pygraphviz
"""

View file

@ -5,10 +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!
C400,C401,C402,C403,C404,C405,C407,C411,
exclude = docs/src,venv,third_party,caffe2,scripts,docs/caffe2,torch/lib/include,torch/lib/tmp_install,build,torch/include,*.pyi
exclude = docs/src,venv,third_party,caffe2,scripts,docs/caffe2,torch/lib/include,torch/lib/tmp_install,build,torch/include,*.pyi,.git

0
binaries/bench_gen/bench_gen.py Normal file → Executable file
View file

View file

@ -1,4 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PyTorch documentation build configuration file, created by

View file

@ -1,4 +1,3 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# PyTorch documentation build configuration file, created by

View file

@ -1,4 +1,3 @@
#!/usr/bin/env python3
from __future__ import absolute_import, division, print_function, unicode_literals
import concurrent.futures

0
test/test_dist_autograd_fork.py Normal file → Executable file
View file

0
test/test_dist_autograd_spawn.py Normal file → Executable file
View file

0
test/test_rpc_fork.py Normal file → Executable file
View file

0
test/test_rpc_spawn.py Normal file → Executable file
View file

0
tools/amd_build/build_amd.py Normal file → Executable file
View file

0
tools/clang_format.py Normal file → Executable file
View file

0
tools/clang_tidy.py Normal file → Executable file
View file

View file

@ -1,4 +1,3 @@
#!/usr/bin/env python3
import collections
from .constants import *