Skip to content
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
18 changes: 13 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,25 @@ repos:
hooks:
- id: uv-lock
args: [--upgrade]
- repo: https://github.com/compwa/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
args:
[
--option,
indent_tables=true,
--option,
indent_entries=true,
--option,
reorder_keys=true,
]
- repo: https://github.com/dycw/pre-commit-hooks
rev: 0.13.10
hooks:
- id: format-requirements
- id: replace-sequence-str
# - id: run-bump-my-version
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.15.0
hooks:
- id: pretty-format-toml
args: [--autofix, --trailing-commas]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.12.0-2
hooks:
Expand Down
334 changes: 167 additions & 167 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,176 +2,176 @@

# build-system
[build-system]
build-backend = "uv_build"
requires = ["uv_build"]
build-backend = "uv_build"
requires = ["uv_build"]

# dependency groups
[dependency-groups]
dev = [
"dycw-utilities[test]",
"pyright[nodejs]",
"rich",
]
dev = ["dycw-utilities[test]", "pyright[nodejs]", "rich"]

# project
[project]
authors = [{name = "Derek Wan", email = "d.wan@icloud.com"}]
dependencies = []
name = "dycw-template"
readme = "README.md"
requires-python = ">= 3.14"
version = "0.1.1"

# bump-my-version
[tool.bumpversion]
allow_dirty = true
current_version = "0.1.1"

[[tool.bumpversion.files]]
filename = "src/dycw_template/__init__.py"
replace = "__version__ = \"{new_version}\""
search = "__version__ = \"{current_version}\""

# coverage
[tool.coverage]

[tool.coverage.html]
directory = ".coverage/html"

[tool.coverage.report]
exclude_also = ["@overload", "if TYPE_CHECKING:"]
fail_under = 100.0
skip_covered = true
skip_empty = true

[tool.coverage.run]
branch = true
data_file = ".coverage/data"
parallel = true

# nitpick
[tool.nitpick]
style = [
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/3.14.toml",
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/common.toml",
]

# pyright
[tool.pyright]
deprecateTypingAliases = true
enableReachabilityAnalysis = false
ignore = ["**/_typeshed/**"]
pythonVersion = "3.14"
reportAny = false
reportCallInDefaultInitializer = true
reportImplicitOverride = true
reportImplicitStringConcatenation = true
reportImportCycles = true
reportMissingSuperCall = true
reportMissingTypeArgument = false
reportMissingTypeStubs = false
reportPrivateUsage = false
reportPropertyTypeMismatch = true
reportShadowedImports = true
reportUninitializedInstanceVariable = true
reportUnknownArgumentType = false
reportUnknownMemberType = false
reportUnknownParameterType = false
reportUnknownVariableType = false
reportUnnecessaryComparison = false
reportUnnecessaryTypeIgnoreComment = true
reportUnusedCallResult = true
reportUnusedImport = false
reportUnusedVariable = false
typeCheckingMode = "strict"

# pytest
[tool.pytest]

[tool.pytest.ini_options]
addopts = [
"-ra",
"-vv",
"--color=auto",
"--cov=dycw_template",
"--cov-config=pyproject.toml",
"--cov-report=html",
"--strict-markers",
]
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
collect_imported_tests = false
filterwarnings = ["error"]
minversion = "8.0"
testpaths = ["src/tests"]
xfail_strict = true

# ruff
[tool.ruff]
src = ["src"]
target-version = "py314"
unsafe-fixes = true

[tool.ruff.format]
preview = true
skip-magic-trailing-comma = true

[tool.ruff.lint]
explicit-preview-rules = true
fixable = ["ALL"]
ignore = [
"ANN401", # any-type
"ASYNC109", # async-function-with-timeout
"C901", # complex-structure
"CPY", # flake8-copyright
"D", # pydocstyle
"DOC", # pydoclint
"E501", # line-too-long
"PD", # pandas-vet
"PERF203", # try-except-in-loop
"PLC0415", # import-outside-top-level
"PLR0904", # too-many-public-methods
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR2004", # magic-value-comparison
"PT012", # pytest-raises-with-multiple-statements
"PT013", # pytest-incorrect-pytest-import
"S202", # tarfile-unsafe-members
"S310", # suspicious-url-open-usage
"S311", # suspicious-non-cryptographic-random-usage
"S602", # subprocess-popen-with-shell-equals-true
"S603", # subprocess-without-shell-equals-true
"S607", # start-process-with-partial-path
# preview
"S101", # assert
# formatter
"W191", # tab-indentation
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
]
preview = true
select = [
"ALL",
# preview
"RUF022", # unsorted-dunder-all
"RUF029", # unused-async
]

[tool.ruff.lint.extend-per-file-ignores]
"src/tests/**/*.py" = [
"S101", # assert-used
]

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
split-on-trailing-comma = false
authors = [{ email = "d.wan@icloud.com", name = "Derek Wan" }]
dependencies = []
name = "dycw-template"
readme = "README.md"
requires-python = ">= 3.14"
version = "0.1.1"


# tool
[tool]

# bump-my-version
[tool.bumpversion]
allow_dirty = true
current_version = "0.1.1"

[[tool.bumpversion.files]]
filename = "src/dycw_template/__init__.py"
replace = "__version__ = \"{new_version}\""
search = "__version__ = \"{current_version}\""

# coverage
[tool.coverage]

[tool.coverage.html]
directory = ".coverage/html"

[tool.coverage.report]
exclude_also = ["@overload", "if TYPE_CHECKING:"]
fail_under = 100.0
skip_covered = true
skip_empty = true

[tool.coverage.run]
branch = true
data_file = ".coverage/data"
parallel = true

# nitpick
[tool.nitpick]
style = [
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/3.14.toml",
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/common.toml",
]

# pyright
[tool.pyright]
deprecateTypingAliases = true
enableReachabilityAnalysis = false
ignore = ["**/_typeshed/**"]
pythonVersion = "3.14"
reportAny = false
reportCallInDefaultInitializer = true
reportImplicitOverride = true
reportImplicitStringConcatenation = true
reportImportCycles = true
reportMissingSuperCall = true
reportMissingTypeArgument = false
reportMissingTypeStubs = false
reportPrivateUsage = false
reportPropertyTypeMismatch = true
reportShadowedImports = true
reportUninitializedInstanceVariable = true
reportUnknownArgumentType = false
reportUnknownMemberType = false
reportUnknownParameterType = false
reportUnknownVariableType = false
reportUnnecessaryComparison = false
reportUnnecessaryTypeIgnoreComment = true
reportUnusedCallResult = true
reportUnusedImport = false
reportUnusedVariable = false
typeCheckingMode = "strict"

# pytest
[tool.pytest]

[tool.pytest.ini_options]
addopts = [
"-ra",
"-vv",
"--color=auto",
"--cov=dycw_template",
"--cov-config=pyproject.toml",
"--cov-report=html",
"--strict-markers",
]
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
collect_imported_tests = false
filterwarnings = ["error"]
minversion = "8.0"
testpaths = ["src/tests"]
xfail_strict = true

# ruff
[tool.ruff]
src = ["src"]
target-version = "py314"
unsafe-fixes = true

[tool.ruff.format]
preview = true
skip-magic-trailing-comma = true

[tool.ruff.lint]
explicit-preview-rules = true
fixable = ["ALL"]
ignore = [
"ANN401", # any-type
"ASYNC109", # async-function-with-timeout
"C901", # complex-structure
"CPY", # flake8-copyright
"D", # pydocstyle
"DOC", # pydoclint
"E501", # line-too-long
"PD", # pandas-vet
"PERF203", # try-except-in-loop
"PLC0415", # import-outside-top-level
"PLR0904", # too-many-public-methods
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR2004", # magic-value-comparison
"PT012", # pytest-raises-with-multiple-statements
"PT013", # pytest-incorrect-pytest-import
"S202", # tarfile-unsafe-members
"S310", # suspicious-url-open-usage
"S311", # suspicious-non-cryptographic-random-usage
"S602", # subprocess-popen-with-shell-equals-true
"S603", # subprocess-without-shell-equals-true
"S607", # start-process-with-partial-path
# preview
"S101", # assert
# formatter
"W191", # tab-indentation
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
]
preview = true
select = [
"ALL",
# preview
"RUF022", # unsorted-dunder-all
"RUF029", # unused-async
]

[tool.ruff.lint.extend-per-file-ignores]
"src/tests/**/*.py" = [
"S101", # assert-used
]

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
split-on-trailing-comma = false
Loading
Loading