diff --git a/.flake8 b/.flake8 index b0b5497bfef..7f7c24a0ee1 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,10 @@ [flake8] +select = B,C,E,F,P,T4,W,B9 max-line-length = 120 # C408 ignored because we like the dict keyword argument syntax -ignore = E203,E305,E402,E721,E741,F401,F403,F405,F821,F841,F999,W503,W504,C408 +# E501 is not flexible enough, we're using B950 instead +ignore = + E203,E305,E402,E501,E721,E741,F401,F403,F405,F821,F841,F999,W503,W504,C408, + # ignores below are temporary, fix them and remove please! + B005,B006,B007,B008,B902,B903 exclude = docs/src,venv,third_party,caffe2,scripts,docs/caffe2,tools/amd_build/pyHIPIFY,torch/lib/include,torch/lib/tmp_install,build,torch/include diff --git a/.jenkins/pytorch/perf_test/compare_with_baseline.py b/.jenkins/pytorch/perf_test/compare_with_baseline.py index 5518e719513..e4f60013b3e 100644 --- a/.jenkins/pytorch/perf_test/compare_with_baseline.py +++ b/.jenkins/pytorch/perf_test/compare_with_baseline.py @@ -62,8 +62,10 @@ print("z-value: ", z_value) if z_value >= 3: raise Exception('''\n z-value >= 3, there is high chance of perf regression.\n -To reproduce this regression, run `cd .jenkins/pytorch/perf_test/ && bash ''' + test_name + '''.sh` on your local machine and compare the runtime before/after your code change. -''') +To reproduce this regression, run +`cd .jenkins/pytorch/perf_test/ && bash {}.sh` on your local machine +and compare the runtime before/after your code change. +'''.format(test_name)) else: print("z-value < 3, no perf regression detected.") if args.update: diff --git a/.travis.yml b/.travis.yml index 6aa70770fc3..408b69509a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,13 +23,13 @@ matrix: script: cd .circleci && ./ensure-consistency.py - name: "Python 2.7 Lint" python: "2.7" - install: pip install flake8 + install: pip install flake8 flake8-bugbear script: flake8 - name: "Python 3.7 Lint" python: "3.7" dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069) sudo: required # required for Python 3.7 (travis-ci/travis-ci#9069) - install: pip install flake8-mypy + install: pip install flake8-mypy flake8-bugbear script: flake8 - name: "MyPy typecheck" python: "3.6"