flake8 hook fix (#15693)

Summary:
This PR bypasses checking the user's configuration entirely and always use strict, since the CI considers it a hard failure if you can't pass flake8.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15693

Differential Revision: D13574889

Pulled By: suo

fbshipit-source-id: f5e1c5731cc49b6223b415317033c275bc7d4fec
This commit is contained in:
Michael Suo
2019-01-03 13:50:42 -08:00
committed by Facebook Github Bot
parent 2403135257
commit dcbc4f32db
2 changed files with 4 additions and 7 deletions

View File

@ -5,7 +5,7 @@ from flake8.main import git
if __name__ == '__main__':
sys.exit(
git.hook(
strict=git.config_for('strict'),
strict=True,
lazy=git.config_for('lazy'),
)
)

View File

@ -1,11 +1,8 @@
#!/bin/bash
set -e
echo "Running pre-commit flake8"
FLAKE8_OUT=$(python tools/flake8_hook.py)
if [[ ${FLAKE8_OUT} ]]
then
echo "${FLAKE8_OUT}"
exit 1
fi
python tools/flake8_hook.py
if [ $(which clang-tidy) ]
then