Skip to content

Commit

Permalink
Add extra linting (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Sep 9, 2024
2 parents da9500c + ad031d6 commit a72a36d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 27 deletions.
27 changes: 19 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -25,31 +25,42 @@ 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]
args: [--strict, --pretty, --show-error-codes, .]
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]
Expand Down
30 changes: 11 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ keywords = [
"humanize time size",
]
license = { text = "MIT" }
maintainers = [
{ name = "Hugo van Kemenade" },
]
authors = [
{ name = "Jason Moiron", email = "[email protected]" },
]
maintainers = [ { name = "Hugo van Kemenade" } ]
authors = [ { name = "Jason Moiron", email = "[email protected]" } ]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand All @@ -38,9 +34,7 @@ classifiers = [
"Topic :: Text Processing",
"Topic :: Text Processing :: General",
]
dynamic = [
"version",
]
dynamic = [ "version" ]
optional-dependencies.tests = [
"freezegun",
"pytest",
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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]
Expand All @@ -113,3 +104,4 @@ filterwarnings = [
# Python <= 3.11
"ignore:sys.monitoring isn't available, using default core:coverage.exceptions.CoverageWarning",
]
testpaths = [ "tests" ]

0 comments on commit a72a36d

Please sign in to comment.