Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Ruff
on:
push:
branches:
- main
- dev
pull_request:
jobs:
ruff:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v3
with:
args: check --output-format=github
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:

# pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
# ruff
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.11.7
hooks:
# Run the linter.
- id: ruff
29 changes: 29 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ docs = [
"numpydoc>=1.5.0",
"myst-nb>=0.17.1",
]
dev = [
{include-group = "docs"},
{include-group = "testing"},
"pre-commit",
"ruff<=0.11.4",
]

[project.optional-dependencies]
jupyter = [
Expand All @@ -77,6 +83,29 @@ jupyter = [
"jupyterlab",
]

[tool.ruff]
src = ["cadetrdm", "tests"]
exclude = ["examples", "docs"]
line-length = 88

[tool.ruff.lint]
preview = true
select = ["E", "F", "W", "D", "ANN"]
ignore = ["D100", "D212", "D203", "ANN401"]
exclude = ['__init__.py']

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.pycodestyle]
max-line-length = 100
max-doc-length = 94

[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D", "E731", "ANN", "E402"]
# E731 are lambda expressions for tests, D are general docstrings


[tool.pytest.ini_options]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
Expand Down
Loading