diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 596336b..1270a4a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ files: 'resample' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-case-conflict - id: check-docstring-first @@ -18,20 +18,15 @@ repos: # Ruff linter, replacement for flake8, isort, pydocstyle - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.4.5' + rev: 'v0.6.9' hooks: - id: ruff - args: [--fix, --exit-non-zero-on-fix] - -# Python formatting -- repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 - hooks: - - id: black + args: [--fix, --show-fixes, --exit-non-zero-on-fix] + - id: ruff-format # Python type checking - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.10.0' + rev: 'v1.11.2' hooks: - id: mypy args: [--allow-redefinition, --ignore-missing-imports] diff --git a/pyproject.toml b/pyproject.toml index 79d8414..e721699 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,16 +46,11 @@ where = ["src"] [tool.setuptools_scm] -[tool.isort] -profile = "black" -multi_line_output = 3 +[tool.ruff.lint] +extend-select = ["D", "I"] +ignore = ["D212", "D211", "D203"] -[tool.ruff] -extend-select = ["E", "F", "W", "D"] -ignore = ["D212", "D203"] -unfixable = ["ERA"] - -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "test_*.py" = ["D"] [tool.mypy] @@ -63,7 +58,6 @@ strict = true no_implicit_optional = false allow_redefinition = true ignore_missing_imports = true -show_error_codes = true files = "src/resample/*.py" [tool.pytest.ini_options] diff --git a/src/resample/_util.py b/src/resample/_util.py index 31add97..e42f645 100644 --- a/src/resample/_util.py +++ b/src/resample/_util.py @@ -7,7 +7,7 @@ def normalize_rng( - random_state: Optional[Union[int, np.random.Generator]] + random_state: Optional[Union[int, np.random.Generator]], ) -> np.random.Generator: """Return normalized RNG object.""" if random_state is None: