Skip to content

Commit

Permalink
Update to hatch v1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 committed Jan 10, 2024
1 parent 04aa605 commit 2699bba
Show file tree
Hide file tree
Showing 2 changed files with 545 additions and 73 deletions.
84 changes: 11 additions & 73 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,29 +54,15 @@ cov = [
[[tool.hatch.envs.all.matrix]]
python = ["3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.lint]
detached = true
[tool.hatch.envs.types]
dependencies = [
"black>=23.1.0",
"mypy>=1.0.0",
"ruff>=0.0.243",
"hypothesis",
]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:src/yut23_utils tests}"
style = [
"ruff {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"style",
]
all = [
"style",
"typing",
]
[tool.hatch.envs.types.scripts]
check = "mypy --install-types --non-interactive {args:src/yut23_utils tests}"

[tool.isort]
known_first_party = ["yut23_utils"]

[tool.black]
target-version = ["py39"]
Expand All @@ -86,61 +72,13 @@ skip-string-normalization = false
[tool.ruff]
target-version = "py39"
line-length = 88
select = [
"A",
"ARG",
"B",
"C",
"DTZ",
"E",
"EM",
"F",
"FBT",
"I",
"ICN",
"ISC",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"T",
"TID",
"UP",
"W",
"YTT",
]
ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
"S105", "S106", "S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
]
unfixable = [
# Don't touch unused imports
"F401",
]

[tool.isort]
known_first_party = ["yut23_utils"]

[tool.ruff.isort]
known-first-party = ["yut23_utils"]
extend = "ruff_defaults.toml"

[tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.hatch.envs.hatch-static-analysis]
config-path = "ruff_defaults.toml"

[tool.ruff.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]
# __init__.py can import things without using them
[tool.ruff.lint.extend-per-file-ignores]
# we expect unused imports in __init__.py, as it shouldn't have anything else
"__init__.py" = ["F401"]

[tool.coverage.run]
Expand Down
Loading

0 comments on commit 2699bba

Please sign in to comment.