Skip to content

Commit

Permalink
ci: pre-commit autoupdate (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jun 14, 2024
1 parent 6e3da99 commit 1245513
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 42 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.8.0
rev: 2.1.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/asottile/setup-cfg-fmt
Expand Down Expand Up @@ -58,12 +58,12 @@ repos:
hooks:
- id: mypy
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.4.3"
rev: "v0.4.7"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/adamchainz/django-upgrade
rev: "1.16.0"
rev: "1.18.0"
hooks:
- id: django-upgrade
args: [--target-version, "5.0"]
86 changes: 47 additions & 39 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ readme = "README.rst"
keywords = [
"Django",
]
license = {file = "LICENSE"}
authors = [{name = "Mark Walker", email = "[email protected]"}]
license = { file = "LICENSE" }
authors = [
{ name = "Mark Walker", email = "[email protected]" },
]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -34,60 +36,60 @@ classifiers = [
"Typing :: Typed",
]
dependencies = [
"Django>=3.2",
"django>=3.2",
"nh3",
]
[project.urls]
Changelog = "https://github.com/marksweb/django-nh3/blob/main/CHANGELOG.rst"
Mastodon = "https://fosstodon.org/@markwalker"
Repository = "https://github.com/marksweb/django-nh3"
Twitter = "https://twitter.com/markwalker_"

urls.Changelog = "https://github.com/marksweb/django-nh3/blob/main/CHANGELOG.rst"

urls.Mastodon = "https://fosstodon.org/@markwalker"

urls.Repository = "https://github.com/marksweb/django-nh3"

urls.Twitter = "https://twitter.com/markwalker_"

[tool.setuptools.packages.find]
where = ["src"]
where = [
"src",
]

[tool.ruff]
extend-exclude = [
"**migrations/**",
".env",
".ruff_cache",
]

# https://beta.ruff.rs/docs/configuration/
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
"Q", # flake8-quotes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
"Q", # flake8-quotes
"PLE", # pylint error
"PLR", # pylint refactor
"PLW", # pylint warning
"UP", # pyupgrade
]

extend-exclude = [
".ruff_cache",
".env",
"**migrations/**",
"UP", # pyupgrade
]

ignore = [
"B006", # Do not use mutable data structures for argument defaults
"PLR0913", # Too many arguments to function call,
"B006", # Do not use mutable data structures for argument defaults
"PLR0913", # Too many arguments to function call,
]

[tool.ruff.per-file-ignores]
"__init__.py" = [
"F401" # unused-import
isort.combine-as-imports = true
# Preserve types, even if a file imports `from __future__ import annotations`.
pyupgrade.keep-runtime-typing = true
per-file-ignores."__init__.py" = [
"F401", # unused-import
]
"src/django_nh3/forms.py" = [
"UP035", # import-replacements - breaks type hint Callable
per-file-ignores."src/django_nh3/forms.py" = [
"UP035", # import-replacements - breaks type hint Callable
]

[tool.ruff.isort]
combine-as-imports = true

[tool.ruff.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true

[tool.pytest]
DJANGO_SETTINGS_MODULE = "tests.settings"
django_find_project = false
Expand All @@ -103,10 +105,16 @@ django_find_project = false
[tool.coverage.run]
branch = true
parallel = true
source = ["django_nh3", "tests"]
source = [
"django_nh3",
"tests",
]

[tool.coverage.paths]
source = ["src", ".tox/py*/**/site-packages"]
source = [
"src",
".tox/py*/**/site-packages",
]

[tool.coverage.report]
show_missing = true
Expand Down

0 comments on commit 1245513

Please sign in to comment.