diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..0c9d6d8 --- /dev/null +++ b/.flake8 @@ -0,0 +1,9 @@ +[flake8] +extend-exclude = .venv +statistics = True +count = True +show-source = True +# The GitHub editor is 127 chars wide +max-line-length = 127 +# Ignore valid SQLAlchemy NULL query syntax +extend-ignore = E711 diff --git a/.gitignore b/.gitignore index 73df3ab..fce99d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ uv.lock -.pre-commit-config.yaml .eggs .env *~ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a9d22c7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + exclude: '^.*\.svg$' + - id: check-yaml + - id: check-added-large-files +- repo: https://github.com/pycqa/flake8 + rev: '7.2.0' + hooks: + - id: flake8 diff --git a/noxfile.py b/noxfile.py index ce2bc04..8fe9295 100644 --- a/noxfile.py +++ b/noxfile.py @@ -57,12 +57,9 @@ def lint(session): """Run flake8.""" session.install("flake8") # stop the linter if there are Python syntax errors or undefined names - session.run( - "flake8", ".", "--count", "--select=E9,F63,F7,F82", "--show-source", "--statistics", "--extend-exclude", ".venv") - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - session.run( - "flake8", ".", "--count", "--exit-zero", "--max-complexity=10", "--extend-ignore=E711", - "--max-line-length=127", "--statistics", "--extend-exclude", ".venv") + session.run("flake8", "--select=E9,F63,F7,F82", "--show-source") + # exit-zero treats all errors as warnings + session.run("flake8", "--exit-zero", "--max-complexity=10") def parametrize_test_versions(): diff --git a/requirements-test.txt b/requirements-test.txt index b8425ec..07d2fbc 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,3 +1,3 @@ pytest pytest-cov -hypothesis \ No newline at end of file +hypothesis