diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d582123..aacda65a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-added-large-files args: [ '--maxkb=500' ] @@ -43,7 +43,7 @@ repos: exclude: ^\.bumpversion\.cfg$ - repo: https://github.com/python-jsonschema/check-jsonschema.git - rev: 0.31.3 + rev: 0.33.3 hooks: - id: check-github-actions - id: check-github-workflows @@ -72,7 +72,7 @@ repos: exclude: ^docs/_static/.*\.(js|html)$|^src/ridgeplot/.*\.c$ - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.10.0.1 + rev: v0.11.0.1 hooks: - id: shellcheck @@ -102,7 +102,7 @@ repos: additional_dependencies: [setuptools-scm] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.2 + rev: v0.12.10 hooks: - id: ruff-format - id: ruff diff --git a/cicd_utils/cicd/test_helpers.py b/cicd_utils/cicd/test_helpers.py index aeca1455..64f254bd 100644 --- a/cicd_utils/cicd/test_helpers.py +++ b/cicd_utils/cicd/test_helpers.py @@ -6,6 +6,7 @@ from importlib.util import module_from_spec, spec_from_file_location from pathlib import Path from typing import TYPE_CHECKING, Any, TypeVar, cast +from unittest.mock import MagicMock, patch if TYPE_CHECKING: from collections.abc import Iterator @@ -22,8 +23,6 @@ def patch_plotly_show() -> Iterator[None]: and, instead, simply call :func:`plotly.io._utils.validate_coerce_fig_to_dict()`. """ - from unittest.mock import MagicMock, patch - from plotly.io._utils import validate_coerce_fig_to_dict def patched( diff --git a/ruff.toml b/ruff.toml index e8f4fc62..a04aa35f 100644 --- a/ruff.toml +++ b/ruff.toml @@ -22,10 +22,29 @@ ignore = [ "FBT", # flake8-boolean-trap "FIX", # flake8-fixme - # flake8-comprehensions + # flake8-commas (COM) + "COM812", # Trailing comma missing + + # flake8-comprehensions (C4) "C408", # Unnecessary `dict` call (rewrite as a literal) - # pydocstyle + # flake8-errmsg (EM) + "EM101", # Exception must not use a string literal, assign to variable first + "EM102", # Exception must not use an f-string literal, assign to variable first + "EM103", # Exception must not use a .format() string directly, assign to variable first + + # flake8-return (RET) + "RET504", # Unnecessary variable assignment before `return` statement + + # flake8-todos (TD) + "TD001", # Invalid TODO tag: `FIXME` + "TD002", # Missing author in [...] + "TD003", # Missing issue link on the line following this TODO + + # flake8-annotations (ANN) + "ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name} + + # pydocstyle (D) "D101", # Missing docstring in public class "D102", # Missing docstring in public method "D103", # Missing docstring in public function @@ -36,43 +55,27 @@ ignore = [ "D400", # First line should end with a period "D415", # First line should end with a period, question mark, or exclamation point - # flake8-return - "RET504", # Unnecessary variable assignment before `return` statement - # eradicate (ERA) "ERA001", # Found commented-out code - # pandas-vet + # pandas-vet (PD) "PD015", # Use `.merge` method instead of `pd.merge` function. They have equivalent functionality. "PD901", # `df` is a bad variable name. Be kinder to your future self. - # pylint + # Convention (PLC) + "PLC0415", # `import` should be at the top-level of a file + + # Refactor (PLR) "PLR0913", # Too many arguments to function call ({x} > 5) "PLR2004", # Magic value used in comparison, consider replacing {x} with a constant variable # tryceratops "TRY003", # Avoid specifying long messages outside the exception class - # flake8-commas (COM) - "COM812", # Trailing comma missing - - # flake8-errmsg (EM) - "EM101", # Exception must not use a string literal, assign to variable first - "EM102", # Exception must not use an f-string literal, assign to variable first - "EM103", # Exception must not use a .format() string directly, assign to variable first - # pep8-naming # (allow for sklearn's naming convention for uppercase `X`) "N803", # Argument name should be lowercase "N806", # Variable in function should be lowercase - - # flake8-todos (TD) - "TD001", # Invalid TODO tag: `FIXME` - "TD002", # Missing author in [...] - "TD003", # Missing issue link on the line following this TODO - - # flake8-annotations (ANN) - "ANN401", # Dynamically typed expressions (typing.Any) are disallowed in {name} ] [lint.per-file-ignores]