From aeda214110049e0ff5af6a88e49a9a01f9182241 Mon Sep 17 00:00:00 2001 From: Rjchauhan18 Date: Sat, 28 Oct 2023 17:57:09 +0530 Subject: [PATCH 1/7] fix/Replace nbqa-ruff with ruff --- .pre-commit-config.yaml | 10 ++-------- ruff.toml | 6 ++++++ 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 ruff.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 12e48d913b..01eb62bcd0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,18 +4,12 @@ ci: repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.1.1" + rev: "v0.1.3" hooks: - id: ruff + types_or: [python, pyi, jupyter] args: [--fix, --ignore=E741, --exclude=__init__.py] - - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.0 - hooks: - - id: nbqa-ruff - additional_dependencies: [ruff==0.0.284] - args: ["--fix","--ignore=E501,E402"] - - repo: https://github.com/adamchainz/blacken-docs rev: "1.16.0" hooks: diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000000..ea62900699 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,6 @@ +[tool.ruff] +extend-include = ["*.ipynb"] + + +[tool.ruff.lint] +ignore = ["E402","E703"] From 641075298495c78cf5c18c02df60c9e6da95087f Mon Sep 17 00:00:00 2001 From: Rjchauhan18 Date: Sat, 28 Oct 2023 18:25:02 +0530 Subject: [PATCH 2/7] added pyproject.toml and removed ruff.toml because of failing pre-commit --- ruff.toml => pyproject.toml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ruff.toml => pyproject.toml (100%) diff --git a/ruff.toml b/pyproject.toml similarity index 100% rename from ruff.toml rename to pyproject.toml From 6cb6347b3adec8ddf5848bf0606586de12d6fe14 Mon Sep 17 00:00:00 2001 From: Rjchauhan18 Date: Sat, 28 Oct 2023 19:53:18 +0530 Subject: [PATCH 3/7] Added ruff.toml again and deleted pyproject.toml --- pyproject.toml | 6 ------ ruff.toml | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) delete mode 100644 pyproject.toml create mode 100644 ruff.toml diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index ea62900699..0000000000 --- a/pyproject.toml +++ /dev/null @@ -1,6 +0,0 @@ -[tool.ruff] -extend-include = ["*.ipynb"] - - -[tool.ruff.lint] -ignore = ["E402","E703"] diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000000..a20f5ea464 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,2 @@ +[lint] +ignore = ["E402","E703"] From 5431decb218cfe70b612e392d3c30cd117558d89 Mon Sep 17 00:00:00 2001 From: Rjchauhan18 Date: Sat, 28 Oct 2023 21:55:36 +0530 Subject: [PATCH 4/7] Added [lint.per-file-ignores] in ruff.toml --- ruff.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruff.toml b/ruff.toml index a20f5ea464..56d383806f 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,2 +1,2 @@ -[lint] -ignore = ["E402","E703"] +[lint.per-file-ignores] +"**.ipynb" = ["E402", "E703"] From 1bc0ba788e3eef37138a8309b787bb3c173c83c6 Mon Sep 17 00:00:00 2001 From: Rjchauhan18 Date: Sun, 29 Oct 2023 19:07:51 +0530 Subject: [PATCH 5/7] trying to move jupyter nootebook configuration of pro-commit-config.yaml to ruff.toml --- .pre-commit-config.yaml | 1 - ruff.toml | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01eb62bcd0..46d6918d95 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,6 @@ repos: rev: "v0.1.3" hooks: - id: ruff - types_or: [python, pyi, jupyter] args: [--fix, --ignore=E741, --exclude=__init__.py] - repo: https://github.com/adamchainz/blacken-docs diff --git a/ruff.toml b/ruff.toml index 56d383806f..7c1040e9d8 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,2 +1,4 @@ +extend-include = ["*.ipynb"] + [lint.per-file-ignores] "**.ipynb" = ["E402", "E703"] From c0f7ead225d2b81ac394c63043a4473de2b4f10c Mon Sep 17 00:00:00 2001 From: Rjchauhan18 Date: Tue, 31 Oct 2023 15:57:41 +0530 Subject: [PATCH 6/7] fix changes as per review added to pre-commit-config.yaml "--show-fixes" and some ruff.toml changes --- .pre-commit-config.yaml | 2 +- ruff.toml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46d6918d95..76ff077177 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: rev: "v0.1.3" hooks: - id: ruff - args: [--fix, --ignore=E741, --exclude=__init__.py] + args: [--fix, --show-fixes] - repo: https://github.com/adamchainz/blacken-docs rev: "1.16.0" diff --git a/ruff.toml b/ruff.toml index 7c1040e9d8..7304d64570 100644 --- a/ruff.toml +++ b/ruff.toml @@ -1,4 +1,8 @@ extend-include = ["*.ipynb"] +extend-exclude = ["__init__.py"] + +[lint] +ignore = ["E741"] [lint.per-file-ignores] "**.ipynb" = ["E402", "E703"] From f91fed90a16b59f7c1e3162f9fed4d904a813890 Mon Sep 17 00:00:00 2001 From: Rjchauhan18 Date: Tue, 31 Oct 2023 18:18:16 +0530 Subject: [PATCH 7/7] added types_or: [python, pyi, jupyter] in pre-commit-config.yaml --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76ff077177..5d7c85492f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,7 @@ repos: hooks: - id: ruff args: [--fix, --show-fixes] + types_or: [python, pyi, jupyter] - repo: https://github.com/adamchainz/blacken-docs rev: "1.16.0"