diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..c904bdca --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,22 @@ +name: 🔎 Lint code ⚡ + +on: + push: + workflow_dispatch: + +jobs: + + lint: + name: Ruff ⚡🕵 + + runs-on: ubuntu-latest + + steps: + + - name: 📥 Checkout repo + uses: actions/checkout@v4 + + - name: Run Ruff checks ⚡ + uses: astral-sh/ruff-action@v3 + with: + args: check diff --git a/pyproject.toml b/pyproject.toml index 8d534db5..0ab51dd3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,3 +34,30 @@ pytest-cov = "^6.0.0" [build-system] build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] + + +[tool.ruff.lint] +exclude = [ + "tests/interactive-imagej/*" +] + +select = [ + "D", + # summary lines have to be placed on the first physical line of the docstring + "D212", + # imperative mood for all docstrings + "D401", + # summary line has to end in a punctuation mark + "D415", + # require documentation for _all_ function parameters + "D417", +] + +ignore = [ + # no blank lines allowed after function docstring + "D202", +] + + +[tool.ruff.lint.pydocstyle] +convention = "numpy" \ No newline at end of file