Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra linting #199

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" ]
Loading