From 75cc393118ae9e29d4ae7eb639714e42fd481ef1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 01:21:46 -0400 Subject: [PATCH] chore: update pre-commit hooks (#557) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.13 → v0.3.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.13...v0.3.4) - [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.0) - [github.com/shellcheck-py/shellcheck-py: v0.9.0.6 → v0.10.0.1](https://github.com/shellcheck-py/shellcheck-py/compare/v0.9.0.6...v0.10.0.1) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 6 +++--- src/hist/axis/__init__.py | 3 +-- src/hist/basehist.py | 3 +-- src/hist/interop.py | 6 ++---- src/hist/plot.py | 2 +- src/hist/stack.py | 6 ++---- src/hist/svgutils.py | 3 +-- 7 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 45f3dc1c..49eb2ff5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.13 + rev: v0.3.4 hooks: - id: ruff args: ["--fix", "--show-fixes"] @@ -33,7 +33,7 @@ repos: types_or: [python, pyi, jupyter] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.8.0 + rev: v1.9.0 hooks: - id: mypy files: ^src @@ -56,6 +56,6 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/shellcheck-py/shellcheck-py - rev: v0.9.0.6 + rev: v0.10.0.1 hooks: - id: shellcheck diff --git a/src/hist/axis/__init__.py b/src/hist/axis/__init__.py index 4a3b7598..909d7c45 100644 --- a/src/hist/axis/__init__.py +++ b/src/hist/axis/__init__.py @@ -40,8 +40,7 @@ class AxisProtocol(Protocol): metadata: Any @property - def name(self) -> str: - ... + def name(self) -> str: ... label: str _ax: CoreAxisProtocol diff --git a/src/hist/basehist.py b/src/hist/basehist.py index 75f56e7c..027cb320 100644 --- a/src/hist/basehist.py +++ b/src/hist/basehist.py @@ -30,8 +30,7 @@ class SupportsLessThan(Protocol): - def __lt__(self, __other: Any) -> bool: - ... + def __lt__(self, __other: Any) -> bool: ... InnerIndexing = Union[ diff --git a/src/hist/interop.py b/src/hist/interop.py index 9dded1f5..495ffc15 100644 --- a/src/hist/interop.py +++ b/src/hist/interop.py @@ -13,13 +13,11 @@ class HistogramModuleProtocol(Protocol[T_contra, U]): - def unpack(self, obj: T_contra) -> dict[str, U] | None: - ... + def unpack(self, obj: T_contra) -> dict[str, U] | None: ... def broadcast_and_flatten( self, objects: Sequence[U | ArrayLike] - ) -> tuple[np.typing.NDArray[Any], ...]: - ... + ) -> tuple[np.typing.NDArray[Any], ...]: ... _histogram_modules: dict[type, HistogramModuleProtocol[Any, Any]] = {} diff --git a/src/hist/plot.py b/src/hist/plot.py index f080ab36..c46c9bbf 100644 --- a/src/hist/plot.py +++ b/src/hist/plot.py @@ -122,7 +122,7 @@ def _expr_to_lambda(expr: str) -> Callable[..., Any]: varnames = list(OrderedDict.fromkeys([name for name in varnames if name != "x"])) lambdastr = f"lambda x,{','.join(varnames)}: {expr}" # pylint: disable-next=eval-used - return eval(lambdastr) # type: ignore[no-any-return] # noqa: PGH001 + return eval(lambdastr) # type: ignore[no-any-return] def _curve_fit_wrapper( diff --git a/src/hist/stack.py b/src/hist/stack.py index 105f79a0..3dfdad52 100644 --- a/src/hist/stack.py +++ b/src/hist/stack.py @@ -72,12 +72,10 @@ def _get_index(self, name: str | int) -> int: raise IndexError(f"Name not found: {name}") @typing.overload - def __getitem__(self, val: int | str) -> BaseHist: - ... + def __getitem__(self, val: int | str) -> BaseHist: ... @typing.overload - def __getitem__(self, val: slice) -> Self: - ... + def __getitem__(self, val: slice) -> Self: ... def __getitem__(self, val: int | slice | str) -> BaseHist | Self: if isinstance(val, str): diff --git a/src/hist/svgutils.py b/src/hist/svgutils.py index 5ca1bc6a..30054e6f 100644 --- a/src/hist/svgutils.py +++ b/src/hist/svgutils.py @@ -4,8 +4,7 @@ class SupportsStr(Protocol): - def __str__(self) -> str: - ... + def __str__(self) -> str: ... class XML: