From e25f49d5fa5811fb31d2ab7109177e1375afd9b6 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sat, 27 Jul 2024 07:00:39 +0200 Subject: [PATCH] Add codespell and ruff linting --- .../workflows/{pytest.yml => lint_and_pytest.yml} | 9 ++++++++- pyproject.toml | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) rename .github/workflows/{pytest.yml => lint_and_pytest.yml} (71%) diff --git a/.github/workflows/pytest.yml b/.github/workflows/lint_and_pytest.yml similarity index 71% rename from .github/workflows/pytest.yml rename to .github/workflows/lint_and_pytest.yml index cb466aba..62bf471b 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/lint_and_pytest.yml @@ -1,9 +1,16 @@ -name: pytest +name: lint_and_pytest on: push: pull_request: workflow_dispatch: jobs: + codespell_and_ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: pip install --user codespell[toml] ruff + - run: codespell + - run: ruff check --output-format=github pytest: strategy: fail-fast: false diff --git a/pyproject.toml b/pyproject.toml index 3db8907f..05ee2b3a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,3 +5,18 @@ requires = [ "setuptools >= 66.1" ] build-backend = "setuptools.build_meta" + +[tool.codespell] +ignore-words-list = "alltime,blong,ccompiler,fo,hel" +skip = "*.bak" + +[tool.ruff.lint] +select = [ + "E9", + "F63", + "F7", + "F82", +] +[tool.ruff.lint.per-file-ignores] +"src/cffi/verifier.py" = ["F821"] +"testing/*" = ["F821"]