diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa1817387..b5c9af0c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: debug-statements - id: mixed-line-ending - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.22 + rev: v0.16.1 hooks: - id: ruff-check - id: ruff-format diff --git a/package/PartSeg/common_gui/colormap_creator.py b/package/PartSeg/common_gui/colormap_creator.py index 75e3e5ddf..e416cda81 100644 --- a/package/PartSeg/common_gui/colormap_creator.py +++ b/package/PartSeg/common_gui/colormap_creator.py @@ -249,8 +249,10 @@ def __init__(self, parent=None): self.reverse_btn = QPushButton("Reverse") self.info_label = InfoLabel( [ - "Tip: Select color and double click on a color bar below. " - "Repeat to add another colors.", + ( + "Tip: Select color and double click on a color bar below. " + "Repeat to add another colors." + ), "Tip: Double click on a marker to remove it.", "Tip: Press and hold mouse left button on a marker to drag and drop it on color bar.", ], diff --git a/package/PartSegCore/mask_create.py b/package/PartSegCore/mask_create.py index 7f072fa1e..77a777a1e 100644 --- a/package/PartSegCore/mask_create.py +++ b/package/PartSegCore/mask_create.py @@ -153,7 +153,7 @@ def _calculate_mask( mask_description: MaskProperty, dilate_radius: list[int], mask: np.ndarray, - old_mask: None | np.ndarray, + old_mask: np.ndarray | None, ) -> np.ndarray: if mask_description.dilate != RadiusType.NO and mask_description.dilate_radius != 0: if mask_description.dilate_radius > 0: diff --git a/package/PartSegImage/image.py b/package/PartSegImage/image.py index 32b0b8a92..4866e3db5 100644 --- a/package/PartSegImage/image.py +++ b/package/PartSegImage/image.py @@ -232,7 +232,7 @@ def __init__( spacing: Spacing, time_increment: float = 1.0, file_path=None, - mask: None | np.ndarray = None, + mask: np.ndarray | None = None, channel_info: list[ChannelInfo | ChannelInfoFull] | None = None, axes_order: str | None = None, shift: Spacing | None = None, diff --git a/pyproject.toml b/pyproject.toml index 6ffd28164..f3ba81d8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -321,6 +321,7 @@ select = [ ignore = ["A003", "SIM108", "ARG002", "ARG003", "ARG004", "PLR2004", "PLR0913", # should be re-enabled in a future version "PLW1641", # Complain about lack of hash in mutable objects" + "PLR0917", # migrate more functions to named only arguments ] [tool.ruff.lint.isort] @@ -336,7 +337,7 @@ max-complexity = 15 [tool.ruff.lint.per-file-ignores] "docs/conf.py" = ["A001"] -"package/tests/**" = ["ARG", "PLC1901", "S101", "RUF012", "ANN", "FBT"] +"package/tests/**" = ["ARG", "PLC1901", "S101", "RUF012", "ANN", "FBT", "PLR0917"] "package/PartSegCore/sphinx/*" = ["ARG"] "package/tests/**.py" = ["PLR2004"] "package/PartSegCore/_old_json_hooks.py" = ["PLR0912", "PLR0911", "PLC0415"]