From a52a9d21a40ee079a64a2bf57f29fac3a3ced7fd Mon Sep 17 00:00:00 2001 From: David Salinas Date: Fri, 14 Jun 2019 17:00:31 +0200 Subject: [PATCH] remove flake8 from githook (#109) * remove flake8 from githook * Update CONTRIBUTING.md * Update dev_setup.sh --- .devtools/githooks/pre-commit | 12 +----------- CONTRIBUTING.md | 2 +- dev_setup.sh | 2 -- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.devtools/githooks/pre-commit b/.devtools/githooks/pre-commit index 21b6c2c94f..0bb38258bc 100755 --- a/.devtools/githooks/pre-commit +++ b/.devtools/githooks/pre-commit @@ -7,9 +7,6 @@ import textwrap from pathlib import Path from subprocess import CalledProcessError, check_output -# Third-party imports -import flake8.main.git - def type_check() -> int: mypy_opts = ['--follow-imports=silent', '--ignore-missing-imports'] @@ -91,12 +88,5 @@ def style_check() -> int: return e.returncode -def flake8_check() -> int: - return flake8.main.git.hook( - strict=flake8.main.git.config_for('strict'), - lazy=flake8.main.git.config_for('lazy'), - ) - - if __name__ == '__main__': - sys.exit(type_check() | style_check() | flake8_check()) + sys.exit(type_check() | style_check()) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fd7b5b0115..9f8a68de20 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,7 +44,7 @@ GitHub provides additional document on [forking a repository](https://help.githu For development you need the requirements listed in all `requirements...txt` files. -We use flake8, mypy, and [black](https://github.com/python/black) for style and +We use [black](https://github.com/python/black) and mypy for style and type checking. Any code changes that you contribute should pass these checks. The easiest way to get set up for development is to run the following script: diff --git a/dev_setup.sh b/dev_setup.sh index 456f9a3ee2..53a8c0bdad 100755 --- a/dev_setup.sh +++ b/dev_setup.sh @@ -54,8 +54,6 @@ fi # update location of Git hooks from default (.git/hooks) to the versioned folder .devtools/githooks git config core.hooksPath ".devtools/githooks" -# use the flake8 Git pre-commit hook in strict mode (i.e., fail the commit on error) -git config --bool flake8.strict true # install project requirements python -m pip install -r requirements-setup.txt