Skip to content

Commit

Permalink
chore: update pre-commit hooks (#557)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.13 →
v0.3.4](astral-sh/ruff-pre-commit@v0.1.13...v0.3.4)
- [github.com/pre-commit/mirrors-mypy: v1.8.0 →
v1.9.0](pre-commit/mirrors-mypy@v1.8.0...v1.9.0)
- [github.com/shellcheck-py/shellcheck-py: v0.9.0.6 →
v0.10.0.1](shellcheck-py/shellcheck-py@v0.9.0.6...v0.10.0.1)
<!--pre-commit.ci end-->

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Mar 28, 2024
1 parent 99f2a0c commit 75cc393
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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
Expand All @@ -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
3 changes: 1 addition & 2 deletions src/hist/axis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ class AxisProtocol(Protocol):
metadata: Any

@property
def name(self) -> str:
...
def name(self) -> str: ...

label: str
_ax: CoreAxisProtocol
Expand Down
3 changes: 1 addition & 2 deletions src/hist/basehist.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@


class SupportsLessThan(Protocol):
def __lt__(self, __other: Any) -> bool:
...
def __lt__(self, __other: Any) -> bool: ...


InnerIndexing = Union[
Expand Down
6 changes: 2 additions & 4 deletions src/hist/interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]] = {}
Expand Down
2 changes: 1 addition & 1 deletion src/hist/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 2 additions & 4 deletions src/hist/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 1 addition & 2 deletions src/hist/svgutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@


class SupportsStr(Protocol):
def __str__(self) -> str:
...
def __str__(self) -> str: ...


class XML:
Expand Down

0 comments on commit 75cc393

Please sign in to comment.