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

Update pre-commit hooks #67

Merged
merged 2 commits into from
May 13, 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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ repos:
hooks:
- id: tox-ini-fmt
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "1.8.0"
rev: "2.0.4"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.9"]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.16.0
rev: 1.17.0
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
Expand Down
136 changes: 80 additions & 56 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ keywords = [
"field",
]
license = "BSD-3-Clause"
authors = [{ name = "Petter Friberg", email = "petter_friberg@hotmail.com" }]
authors = [
{ name = "Petter Friberg", email = "petter_friberg@hotmail.com" },
]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -40,7 +42,7 @@ dynamic = [
"version",
]
dependencies = [
"Django>=3.2",
"django>=3.2",
]
optional-dependencies.test = [
"django-stubs",
Expand All @@ -57,13 +59,20 @@ build.hooks.vcs.version-file = "src/choicefield/_version.py"
version.source = "vcs"

[tool.hatch.build.targets.wheel]
packages = ["src/choicefield"]
packages = [
"src/choicefield",
]

[tool.black]
target-version = ["py39"]
target-version = [
"py39",
]

[tool.ruff]
src = ["src", "tests"]
src = [
"src",
"tests",
]
fix = true
exclude = [
".git",
Expand All @@ -77,72 +86,85 @@ exclude = [
ignore = [
"DJ001", # Allow null=True
"DJ008", # Don't require a __str__ method
"RET505", # We don't like this option
"RET506", # We don't like this option
"S101", # Allow asserts
"TRY003", # We don't care about length of messages for exception classes
"RET505", # We don't like this option
"RET506", # We don't like this option
"S101", # Allow asserts
"TRY003", # We don't care about length of messages for exception classes
]
line-length = 88
select = [
"A",
"B",
"BLE",
"C4",
"C9",
"C90",
"DJ",
"DTZ",
"E",
"EXE",
"F",
"FA",
"FBT",
"I",
"INP",
"ISC",
"N",
"PGH",
"PIE",
"PL",
"PT",
"PTH",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"SLOT",
"T10",
"T20",
"TID",
"TRY",
"UP",
"W",
"YTT"
"A",
"B",
"BLE",
"C4",
"C9",
"C90",
"DJ",
"DTZ",
"E",
"EXE",
"F",
"FA",
"FBT",
"I",
"INP",
"ISC",
"N",
"PGH",
"PIE",
"PL",
"PT",
"PTH",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"SLOT",
"T10",
"T20",
"TID",
"TRY",
"UP",
"W",
"YTT",
]
target-version = "py39"

[tool.ruff.per-file-ignores]
"tests/**" = ["S105", "S106"]
"tests/**" = [
"S105",
"S106",
]

[tool.ruff.mccabe]
max-complexity = 8

[tool.ruff.isort]
known-first-party = ["src/", "tests/"]
known-first-party = [
"src/",
"tests/",
]
combine-as-imports = true

[tool.ruff.pylint]
allow-magic-value-types = ["str", "bytes", "int"]
allow-magic-value-types = [
"str",
"bytes",
"int",
]

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

[tool.coverage.run]
source = ["choicefield", "tests"]
source = [
"choicefield",
"tests",
]
branch = true
omit = [
"*/migrations/*",
Expand All @@ -158,12 +180,6 @@ exclude_lines = [
"if TYPE_CHECKING:",
]

[[tool.mypy.overrides]]
module = [
"*.migrations.*",
]
ignore_errors = true

[tool.mypy]
python_version = "3.10"
pretty = true
Expand All @@ -176,7 +192,15 @@ ignore_missing_imports = false
warn_unreachable = true
strict = true

plugins = ["mypy_django_plugin.main"]
plugins = [
"mypy_django_plugin.main",
]

[[tool.mypy.overrides]]
module = [
"*.migrations.*",
]
ignore_errors = true

[tool.django-stubs]
django_settings_module = "tests.settings"
Loading