From 58fba88e515f071a4f71c21c95ba2d1532ea1d86 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 29 Jul 2024 13:43:49 +0100 Subject: [PATCH] run ruff checks on notebooks --- .pre-commit-config.yaml | 13 +++---------- job_list.ipynb | 4 ++-- pyproject.toml | 1 + 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1fc865e12..658562e09 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/job_list.ipynb b/job_list.ipynb index 92a32d5df..ddc7f7343 100644 --- a/job_list.ipynb +++ b/job_list.ipynb @@ -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" ] }, { @@ -37,7 +37,7 @@ "metadata": {}, "outputs": [], "source": [ - "qi.table # noqa: B018" + "qi.table" ] } ], diff --git a/pyproject.toml b/pyproject.toml index 7fc3be4b5..dd0525383 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"]