Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up handling of flake8 #258

Merged
merged 1 commit into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
[flake8]
ignore = E501, W503, E402
builtins = "c, get_config"
exclude = [
exclude =
.cache,
.github,
docs
]

enable-extensions = "G"
extend-ignore = [
extend-ignore =
G001, G002, G004, G200, G201, G202,
# black adds spaces around ':'
E203
]
per-file-ignores = [
per-file-ignores =
# B011: Do not call assert False since python -O removes these calls
# F841 local variable 'foo' is assigned to but never used
tests/*: B011, F841
]
20 changes: 20 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,23 @@ jobs:
run: make
- name: Make sure the package is release-able
run: make release_prep

pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage=manual
- name: Help message if pre-commit fail
if: ${{ failure() }}
run: |
echo "You can install pre-commit hooks to automatically run formatting"
echo "on each commit with:"
echo " pre-commit install"
echo "or you can run by hand on staged files with"
echo " pre-commit run"
echo "or after-the-fact on already committed files with"
echo " pre-commit run --all-files --hook-stage=manual"
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ repos:
- id: flake8
additional_dependencies:
["flake8-bugbear==22.6.22", "flake8-implicit-str-concat==0.2.0"]
stages: [manual]

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.18.1
Expand Down