diff --git a/.flake8 b/.flake8 deleted file mode 100644 index 1548c564..00000000 --- a/.flake8 +++ /dev/null @@ -1,30 +0,0 @@ -[flake8] -ignore = BLK100 - -# flake8-quotes: -# Use double quotes as our default to comply with black, we like it and -# don't want to use single quotes anymore. -# We would love to configure this via our pyproject.toml but flake8-3.8 does -# not support it yet. -inline-quotes = double -multiline-quotes = double -docstring-quotes = double -avoid-escape = True - -# flake8-docstrings -# Use the Google Python Styleguide Docstring format. -docstring-convention = google - -exclude = - .git, - __pycache__, - docs/source/conf.py, - old, - build, - dist, - venv, - docs, - examples, - test - -max-line-length = 120 diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 6daaf15b..20d1bfc2 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -23,6 +23,9 @@ jobs: poetry --version poetry install + - name: Install ruff + run: python -m pip install ruff==0.16.9 + - name: Run tests and linters run: | #!/bin/sh -e @@ -35,4 +38,4 @@ jobs: ${PREFIX}black photoshop --check ${PREFIX}isort --check-only photoshop - ${PREFIX}flake8 photoshop --max-line-length 120 + ruff check photoshop diff --git a/.hound.yml b/.hound.yml deleted file mode 100644 index faeeeeb9..00000000 --- a/.hound.yml +++ /dev/null @@ -1,8 +0,0 @@ -python: - enabled: true - -flake8: - enabled: true - config_file: .flake8 - -fail_on_violations: true diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index c205a4ef..00000000 --- a/.pylintrc +++ /dev/null @@ -1,7 +0,0 @@ -# Generated Pylint configuration file that disables default output tables. - -[MESSAGES CONTROL] -disable=RP0001,RP0002,RP0003,RP0101,RP0401,RP0402,RP0701,RP0801,C0103,R0903 - -[REPORTS] -output-format=text diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1ccbd628..00000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: python -python: - - "3.8" - - "3.9" - - "3.10" -before_script: - - pip install poetry - - poetry install -script: - - poetry run codecov - -cache: pip -before_cache: - - rm -f $HOME/.cache/pip/log/debug.log diff --git a/pyproject.toml b/pyproject.toml index 6c29e7bc..c0f7419e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -110,3 +110,33 @@ force_single_line = true # All project unrelated unknown imports belong to third-party. default_section = "THIRDPARTY" skip_glob = "*/docs/conf.py" + +# Linting lives here and nowhere else. This replaces the deleted .flake8, which +# flake8 could not express in pyproject.toml (support landed in flake8 5). +[tool.ruff] +line-length = 120 +target-version = "py38" +extend-exclude = [ + "docs/source/conf.py", + "old", + "build", + "dist", + "venv", + "docs", + "examples", + "test", +] + +[tool.ruff.lint] +# Behaviour-preserving port of .flake8. The old file also configured +# flake8-docstrings (google) and flake8-quotes, but neither plugin was installed +# in CI, so only pycodestyle/pyflakes rules ever fired. Quote rules are enabled +# here because the codebase already satisfies them; the docstring rules are not, +# see the migration PR for the measured violation count. +select = ["E", "W", "F", "Q"] + +[tool.ruff.lint.flake8-quotes] +inline-quotes = "double" +multiline-quotes = "double" +docstring-quotes = "double" +avoid-escape = true