Skip to content

Commit

Permalink
run ruff checks on notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Jul 29, 2024
1 parent 370cbac commit 4bc07a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
13 changes: 3 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,16 @@ repos:
hooks:
- id: check-github-workflows

# TODO: Ruff now supports notebooks natively, remove this
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.5
hooks:
- id: nbqa-pyupgrade
args: [--py38-plus]
- id: nbqa-ruff
args: [--ignore=E402, --fix]

- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
- id: nbstripout

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.4
rev: v0.5.5
hooks:
- id: ruff
types_or: [python, pyi, jupyter]
args: [--fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
4 changes: 2 additions & 2 deletions job_list.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"from aiidalab_qe.app.utils.search_jobs import QueryInterface\n",
"\n",
"qi = QueryInterface()\n",
"qi.filters_layout # noqa: B018"
"qi.filters_layout"
]
},
{
Expand All @@ -37,7 +37,7 @@
"metadata": {},
"outputs": [],
"source": [
"qi.table # noqa: B018"
"qi.table"
]
}
],
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ line-length = 88
show-fixes = true
output-format = "full"
target-version = "py39"
extend-include = ["*.ipynb"]

[tool.ruff.lint]
ignore = ["E501", "E402", "TRY003", "RUF012", "N806"]
Expand Down

0 comments on commit 4bc07a2

Please sign in to comment.