Skip to content

Commit

Permalink
CI: Add pyflakes
Browse files Browse the repository at this point in the history
This adds `pyflakes` for code linting in pre-commits.

This is performed via `flake8 --select=F`, skipping all other stylistic
checks of flake8 (which we perform with other tools such as black
and isort). Also, `flake8` supports `...  # noqa` annotations to
silence warnings from `pyflakes`.
  • Loading branch information
ax3l committed Oct 18, 2023
1 parent 21ccdf9 commit 755dc01
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,6 @@ repos:
- id: isort
name: isort (python)

# Python: Flake8 (checks only, does this support auto-fixes?)
#- repo: https://github.com/PyCQA/flake8
# rev: 4.0.1
# hooks:
# - id: flake8
# additional_dependencies: &flake8_dependencies
# - flake8-bugbear
# - pep8-naming
# exclude: ^(docs/.*|tools/.*)$
# Alternatively: use autopep8?

# Python Formatting
- repo: https://github.com/psf/black
rev: 23.9.1 # Keep in sync with blacken-docs
Expand All @@ -110,6 +99,17 @@ repos:
- black==23.9.1 # keep in sync with black hook
# TODO: black-jupyter

# Python: Flake8 (only for pyflake)
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: &flake8_dependencies
- flake8-bugbear
- Flake8-pyproject
# exclude: ^(docs/.*|tools/.*)$
# Alternatively: use autopep8?

# Jupyter Notebooks: clean up all cell outputs
- repo: https://github.com/roy-ht/pre-commit-jupyter
rev: v1.2.1
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ requires = [
"cmake>=3.20.0,<4.0.0"
]
build-backend = "setuptools.build_meta"


[tool.flake8]
#ignore = ['E231', 'E241']
select = ['F']

0 comments on commit 755dc01

Please sign in to comment.