diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..2219eb88 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,12 @@ +name: lint +on: + push: + pull_request: + workflow_dispatch: +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: codespell-project/actions-codespell@v2 + - uses: astral-sh/ruff-action@v3 diff --git a/pyproject.toml b/pyproject.toml index abd7b948..6fc16a8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,3 +48,19 @@ Downloads = "https://github.com/python-cffi/cffi/releases" Contact = "https://groups.google.com/forum/#!forum/python-cffi" "Source Code" = "https://github.com/python-cffi/cffi" "Issue Tracker" = "https://github.com/python-cffi/cffi/issues" + +[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"] + diff --git a/testing/cffi1/test_re_python.py b/testing/cffi1/test_re_python.py index 91edd9b7..65369771 100644 --- a/testing/cffi1/test_re_python.py +++ b/testing/cffi1/test_re_python.py @@ -299,7 +299,7 @@ def test_rec_structs_1(): # from _rec_structs_1 import ffi # the following line used to raise TypeError - # unless preceeded by 'ffi.sizeof("struct C")'. + # unless preceded by 'ffi.sizeof("struct C")'. sz = ffi.sizeof("struct B") assert sz == ffi.sizeof("int *")