diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8bbe542..92c57c3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,12 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.6.4 hooks: - id: ruff args: [--exit-non-zero-on-fix] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black @@ -25,8 +25,19 @@ repos: - id: trailing-whitespace exclude: \.github/ISSUE_TEMPLATE\.md|\.github/PULL_REQUEST_TEMPLATE\.md + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.29.2 + hooks: + - id: check-github-workflows + - id: check-renovate + + - repo: https://github.com/rhysd/actionlint + rev: v1.7.1 + hooks: + - id: actionlint + - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.1 + rev: v1.11.2 hooks: - id: mypy additional_dependencies: [pytest, types-freezegun, types-setuptools] @@ -34,22 +45,22 @@ repos: pass_filenames: false - repo: https://github.com/tox-dev/pyproject-fmt - rev: 2.1.3 + rev: 2.2.3 hooks: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.18 + rev: v0.19 hooks: - id: validate-pyproject - repo: https://github.com/tox-dev/tox-ini-fmt - rev: 1.3.1 + rev: 1.3.2 hooks: - id: tox-ini-fmt - - repo: https://github.com/pre-commit/mirrors-prettier - rev: v4.0.0-alpha.8 + - repo: https://github.com/rbubley/mirrors-prettier + rev: v3.3.3 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88] diff --git a/pyproject.toml b/pyproject.toml index e151cd6..cb46e8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,12 +13,8 @@ keywords = [ "humanize time size", ] license = { text = "MIT" } -maintainers = [ - { name = "Hugo van Kemenade" }, -] -authors = [ - { name = "Jason Moiron", email = "jmoiron@jmoiron.net" }, -] +maintainers = [ { name = "Hugo van Kemenade" } ] +authors = [ { name = "Jason Moiron", email = "jmoiron@jmoiron.net" } ] requires-python = ">=3.8" classifiers = [ "Development Status :: 5 - Production/Stable", @@ -38,9 +34,7 @@ classifiers = [ "Topic :: Text Processing", "Topic :: Text Processing :: General", ] -dynamic = [ - "version", -] +dynamic = [ "version" ] optional-dependencies.tests = [ "freezegun", "pytest", @@ -57,9 +51,7 @@ urls.Source = "https://github.com/python-humanize/humanize" version.source = "vcs" [tool.hatch.build] -artifacts = [ - "*.mo", -] +artifacts = [ "*.mo" ] [tool.hatch.version.raw-options] local_scheme = "no-local-version" @@ -74,6 +66,7 @@ lint.select = [ "EM", # flake8-errmsg "F", # pyflakes errors "I", # isort + "ICN", # flake8-import-conventions "ISC", # flake8-implicit-str-concat "LOG", # flake8-logging "PGH", # pygrep-hooks @@ -84,7 +77,7 @@ lint.select = [ "W", # pycodestyle warnings "YTT", # flake8-2020 ] -lint.extend-ignore = [ +lint.ignore = [ "E203", # Whitespace before ':' "E221", # Multiple spaces before operator "E226", # Missing whitespace around arithmetic operator @@ -93,12 +86,10 @@ lint.extend-ignore = [ lint.per-file-ignores."tests/*" = [ "D", ] -lint.isort.known-first-party = [ - "humanize", -] -lint.isort.required-imports = [ - "from __future__ import annotations", -] +lint.flake8-import-conventions.aliases.datetime = "dt" +lint.flake8-import-conventions.banned-from = [ "datetime" ] +lint.isort.known-first-party = [ "humanize" ] +lint.isort.required-imports = [ "from __future__ import annotations" ] lint.pydocstyle.convention = "google" [tool.pyproject-fmt] @@ -113,3 +104,4 @@ filterwarnings = [ # Python <= 3.11 "ignore:sys.monitoring isn't available, using default core:coverage.exceptions.CoverageWarning", ] +testpaths = [ "tests" ]