-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop Py3.8 support, enable strict mypy and address
- Loading branch information
Showing
7 changed files
with
54 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,3 +45,4 @@ repos: | |
- . | ||
args: | ||
[--no-strict-optional, --ignore-missing-imports, --show-error-codes] | ||
exclude: tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,13 @@ build-backend = "hatchling.build" | |
name = "pre_commit_hooks" | ||
description = "A selection of pre-commit hooks for pre-commit.com." | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
requires-python = ">=3.10" | ||
license = "GPL-3.0-or-later" | ||
keywords = ["pre-commit"] | ||
authors = [{ name = "adehad", email = "[email protected]" }] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
|
@@ -67,19 +65,20 @@ lint = "python -m pre_commit run --color=always {args:--all-files}" | |
# Tests | ||
######################################################################################## | ||
[[tool.hatch.envs.test.matrix]] | ||
python = ["38", "39", "310", "311"] | ||
python = ["310", "311"] | ||
|
||
######################################################################################## | ||
# External Tool Config | ||
######################################################################################## | ||
[tool.mypy] | ||
python_version = '3.8' | ||
python_version = '3.10' | ||
strict = true | ||
ignore_missing_imports = true | ||
namespace_packages = true | ||
show_error_codes = true | ||
strict_optional = true | ||
warn_unused_configs = true | ||
exclude = ["tests/"] | ||
|
||
[tool.coverage.run] | ||
branch = true | ||
|
@@ -89,7 +88,7 @@ omit = ["src/pre_commit_hooks/__about__.py"] | |
[tool.coverage.report] | ||
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"] | ||
|
||
[tool.ruff] | ||
[tool.ruff.lint] | ||
select = [ | ||
"E", # pycodestyle | ||
"W", # pycodestyle | ||
|
@@ -101,22 +100,23 @@ select = [ | |
] | ||
ignore = [] | ||
|
||
# Same as Black. | ||
line-length = 88 | ||
|
||
# Allow unused variables when underscore-prefixed. | ||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" | ||
|
||
# Assume Python 3.8. (minimum supported) | ||
target-version = "py38" | ||
[tool.ruff] | ||
# Same as Black. | ||
line-length = 88 | ||
|
||
# Assume Python 3.10. (minimum supported) | ||
target-version = "py310" | ||
|
||
# The source code paths to consider, e.g., when resolving first- vs. third-party imports | ||
src = ["pre_commit_hooks", "tests"] | ||
|
||
[tool.ruff.isort] | ||
[tool.ruff.lint.isort] | ||
known-first-party = ["pre_commit_hooks", "tests"] | ||
required-imports = ["from __future__ import annotations"] | ||
|
||
[tool.ruff.pydocstyle] | ||
[tool.ruff.lint.pydocstyle] | ||
# Use Google-style docstrings. | ||
convention = "google" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
extend = "../pyproject.toml" | ||
[lint] | ||
ignore = [ | ||
"D", # Allow undocumented test functions | ||
] |