From 4deb784129f1e2c1cdadbe1c27c2be4b404a69dd Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Thu, 30 May 2019 02:01:33 -0700 Subject: Fix pre-commit configuration Excluded files and directories in the flake8 config file are overwritten by the --files argument, which is considered intended behaviour. However, this is problematic due to pre-commit's reliance on the --files argument. Therefore, pre-commit's own exclude config option must be leveraged. * Properly exclude tests directory * Add flake8 plugins as dependencies so that they are actually used --- .pre-commit-config.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1d75342..5d2d40a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,4 +2,17 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.0.0 hooks: - - id: flake8 \ No newline at end of file + - id: flake8 + args: [--config=.flake8] + exclude: ^tests/ + additional_dependencies: [ + flake8-docstrings, + flake8-bugbear, + flake8-import-order, + flake8-tidy-imports, + flake8-todo, + flake8-string-format, + flake8-formatter-junit-xml, + flake8-quotes + ] + -- cgit v1.2.3