From 6058790da8c78d22c98d54c738392f3cc841de2e Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Tue, 2 Apr 2024 18:19:34 +0200 Subject: [PATCH 1/4] update pre-commits --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f2a038d..e621614 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: files: requirements-dev.txt - repo: https://github.com/psf/black - rev: 24.1.1 + rev: 24.3.0 hooks: - id: black language_version: python3 @@ -45,7 +45,7 @@ repos: - id: add-trailing-comma - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.2.0 + rev: v0.3.5 hooks: - id: ruff From deb502fd88ac24e4df2e90a5e573d56c83b69b49 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Tue, 2 Apr 2024 18:19:39 +0200 Subject: [PATCH 2/4] fix warnings --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a0a721e..5be7926 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ write_to_template = "__version__ = '{version}'" tag_regex = "^(?Pv)?(?P[^\\+]+)(?P.*)?$" [tool.ruff] -select = [ +lint.select = [ "A", # flake8-builtins "B", # flake8-bugbear "C4", # flake8-comprehensions @@ -58,7 +58,7 @@ select = [ target-version = "py39" line-length = 80 -[tool.ruff.per-file-ignores] +[lint.file-ignores] "docs/source/conf.py" = [ "E402", "A001", From 3cb2307aced871f3e4be39c28880882be33108bc Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Tue, 2 Apr 2024 18:20:06 +0200 Subject: [PATCH 3/4] fix with ruff --- tests/test_plotting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_plotting.py b/tests/test_plotting.py index 01e3401..89edafa 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -24,8 +24,8 @@ def _assert_is_valid_plot_return_object(objs): else: assert isinstance(objs, (plt.Artist, tuple, dict)), ( "objs is neither an ndarray of Artist instances nor a " - 'single Artist instance, tuple, or dict, "objs" is a {!r} ' - "".format(objs.__class__.__name__) + f'single Artist instance, tuple, or dict, "objs" is a {objs.__class__.__name__!r} ' + "" ) From ebf68281f2b841ee91c45f053cd4a7cedb6b693e Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Tue, 2 Apr 2024 18:24:12 +0200 Subject: [PATCH 4/4] fix syntax and add comments --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5be7926..ce0a097 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,10 +58,11 @@ lint.select = [ target-version = "py39" line-length = 80 -[lint.file-ignores] +# [lint.per-file-ignores] +[tool.ruff.per-file-ignores] "docs/source/conf.py" = [ - "E402", - "A001", + "E402", # Module level import not at top of file + "A001", # builtin-variable-shadowing ] [tool.check-manifest]