diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 1c5aff8..cb707ed 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -26,6 +26,10 @@ "fileMatch": ["requirements.*\.txt$"] }, + "pre-commit": { + "enabled": true + }, + "labels": [ "renovate" ], diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..122917d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,23 @@ +repos: + - repo: https://github.com/PyCQA/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + additional_dependencies: + - flake8-executable==2.1.3 + - bandit==1.7.4 + - flake8-bugbear==21.11.29 + - flake8-comprehensions==3.10.1 + args: [ "--max-line-length", "120" ] + exclude: "tests/to-be-tested/" + - repo: https://github.com/pre-commit/mirrors-mypy + rev: 'v0.991' + hooks: + - id: mypy + files: ^flake8_executable + exclude: "tests/" + - repo: https://github.com/asottile/yesqa + rev: v1.4.0 + hooks: + - id: yesqa + exclude: "tests/to-be-tested/" diff --git a/README.md b/README.md index 2b1f1d5..4b24aac 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,18 @@ Run: pip install flake8-executable +Or through `pre-commit` with the `.pre-commit-config.yaml`: + +```yaml +repos: +- repo: https://github.com/PyCQA/flake8 + rev: 6.0.0 # replace with the latest flake8 release + hooks: + - id: flake8 + additional_dependencies: + - flake8-executable +``` + ## Usage Normally, after flake8-executable is installed, invoking flake8 will also run this plugin. For more