dycw-pre-commit-hooks 0.13.9__tar.gz → 0.13.22__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dycw-pre-commit-hooks might be problematic. Click here for more details.
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/PKG-INFO +14 -13
- dycw_pre_commit_hooks-0.13.22/pyproject.toml +196 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/__init__.py +1 -1
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/check_version_bumped/__init__.py +2 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/check_version_bumped/check-version-bumped +1 -1
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/common.py +2 -2
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/tag_commits/__init__.py +6 -2
- dycw_pre_commit_hooks-0.13.9/.gitignore +0 -166
- dycw_pre_commit_hooks-0.13.9/pyproject.toml +0 -218
- dycw_pre_commit_hooks-0.13.9/src/tests/__init__.py +0 -0
- dycw_pre_commit_hooks-0.13.9/src/tests/format_requirements/__init__.py +0 -0
- dycw_pre_commit_hooks-0.13.9/src/tests/format_requirements/in.toml +0 -30
- dycw_pre_commit_hooks-0.13.9/src/tests/format_requirements/out.toml +0 -30
- dycw_pre_commit_hooks-0.13.9/src/tests/format_requirements/test_format_requirements.py +0 -15
- dycw_pre_commit_hooks-0.13.9/src/tests/test_main.py +0 -7
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/README.md +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/check_submodules_updated/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/check_submodules_updated/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/check_submodules_updated/check-submodules-updated +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/check_version_bumped/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/format_requirements/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/format_requirements/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/mirror_files/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/mirror_files/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/py.typed +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/replace_sequence_str/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/replace_sequence_str/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/run_bump_my_version/__init__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/run_bump_my_version/__main__.py +0 -0
- {dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/tag_commits/__main__.py +0 -0
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: dycw-pre-commit-hooks
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.22
|
|
4
|
+
Author: Derek Wan
|
|
4
5
|
Author-email: Derek Wan <d.wan@icloud.com>
|
|
5
|
-
Requires-
|
|
6
|
-
Requires-Dist:
|
|
7
|
-
Requires-Dist:
|
|
8
|
-
Requires-Dist:
|
|
9
|
-
Requires-Dist:
|
|
10
|
-
Requires-Dist:
|
|
11
|
-
Requires-Dist:
|
|
12
|
-
Requires-Dist:
|
|
13
|
-
Requires-Dist:
|
|
14
|
-
Requires-Dist:
|
|
15
|
-
Requires-
|
|
6
|
+
Requires-Dist: click>=8.3.0,<8.4
|
|
7
|
+
Requires-Dist: dycw-utilities>=0.168.9,<0.169
|
|
8
|
+
Requires-Dist: gitpython>=3.1.45,<3.2
|
|
9
|
+
Requires-Dist: libcst>=1.8.5,<1.9
|
|
10
|
+
Requires-Dist: loguru>=0.7.3,<0.8
|
|
11
|
+
Requires-Dist: more-itertools>=10.8.0,<10.9
|
|
12
|
+
Requires-Dist: orjson>=3.11.3,<3.12
|
|
13
|
+
Requires-Dist: packaging>=25.0,<25.1
|
|
14
|
+
Requires-Dist: tomlkit>=0.13.3,<0.14
|
|
15
|
+
Requires-Dist: xdg-base-dirs>=6.0.2,<6.1
|
|
16
|
+
Requires-Python: >=3.13
|
|
16
17
|
Description-Content-Type: text/markdown
|
|
17
18
|
|
|
18
19
|
# pre-commit-hooks
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# build-system
|
|
2
|
+
[build-system]
|
|
3
|
+
build-backend = "uv_build"
|
|
4
|
+
requires = ["uv_build"]
|
|
5
|
+
|
|
6
|
+
# dependency groups
|
|
7
|
+
[dependency-groups]
|
|
8
|
+
dev = ["dycw-utilities[test]", "pyright[nodejs]", "rich"]
|
|
9
|
+
|
|
10
|
+
# project
|
|
11
|
+
[project]
|
|
12
|
+
authors = [{ email = "d.wan@icloud.com", name = "Derek Wan" }]
|
|
13
|
+
dependencies = [
|
|
14
|
+
"click >=8.3.0, <8.4",
|
|
15
|
+
"dycw-utilities >=0.168.9, <0.169",
|
|
16
|
+
"gitpython >=3.1.45, <3.2",
|
|
17
|
+
"libcst >=1.8.5, <1.9",
|
|
18
|
+
"loguru >=0.7.3, <0.8",
|
|
19
|
+
"more-itertools >=10.8.0, <10.9",
|
|
20
|
+
"orjson >=3.11.3, <3.12",
|
|
21
|
+
"packaging >=25.0, <25.1",
|
|
22
|
+
"tomlkit >=0.13.3, <0.14",
|
|
23
|
+
"xdg-base-dirs >=6.0.2, <6.1",
|
|
24
|
+
]
|
|
25
|
+
name = "dycw-pre-commit-hooks"
|
|
26
|
+
readme = "README.md"
|
|
27
|
+
requires-python = ">= 3.13"
|
|
28
|
+
version = "0.13.22"
|
|
29
|
+
|
|
30
|
+
[project.scripts]
|
|
31
|
+
check-submodules-updated = "pre_commit_hooks.check_submodules_updated:main"
|
|
32
|
+
check-version-bumped = "pre_commit_hooks.check_version_bumped:main"
|
|
33
|
+
format-requirements = "pre_commit_hooks.format_requirements:main"
|
|
34
|
+
mirror-files = "pre_commit_hooks.mirror_files:main"
|
|
35
|
+
replace-sequence-str = "pre_commit_hooks.replace_sequence_str:main"
|
|
36
|
+
run-bump-my-version = "pre_commit_hooks.run_bump_my_version:main"
|
|
37
|
+
tag-commits = "pre_commit_hooks.tag_commits:main"
|
|
38
|
+
|
|
39
|
+
# tool
|
|
40
|
+
[tool]
|
|
41
|
+
|
|
42
|
+
# bump-my-version
|
|
43
|
+
[tool.bumpversion]
|
|
44
|
+
allow_dirty = true
|
|
45
|
+
current_version = "0.13.22"
|
|
46
|
+
|
|
47
|
+
[[tool.bumpversion.files]]
|
|
48
|
+
filename = "src/pre_commit_hooks/__init__.py"
|
|
49
|
+
replace = "__version__ = \"{new_version}\""
|
|
50
|
+
search = "__version__ = \"{current_version}\""
|
|
51
|
+
|
|
52
|
+
# coverage
|
|
53
|
+
[tool.coverage]
|
|
54
|
+
|
|
55
|
+
[tool.coverage.html]
|
|
56
|
+
directory = ".coverage/html"
|
|
57
|
+
|
|
58
|
+
[tool.coverage.report]
|
|
59
|
+
exclude_also = ["@overload", "if TYPE_CHECKING:"]
|
|
60
|
+
fail_under = 100.0
|
|
61
|
+
skip_covered = true
|
|
62
|
+
skip_empty = true
|
|
63
|
+
|
|
64
|
+
[tool.coverage.run]
|
|
65
|
+
branch = true
|
|
66
|
+
data_file = ".coverage/data"
|
|
67
|
+
parallel = true
|
|
68
|
+
|
|
69
|
+
# nitpick
|
|
70
|
+
[tool.nitpick]
|
|
71
|
+
style = [
|
|
72
|
+
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/3.13.toml",
|
|
73
|
+
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/common.toml",
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
# pyright
|
|
77
|
+
[tool.pyright]
|
|
78
|
+
deprecateTypingAliases = true
|
|
79
|
+
enableReachabilityAnalysis = false
|
|
80
|
+
ignore = ["**/_typeshed/**"]
|
|
81
|
+
pythonVersion = "3.13"
|
|
82
|
+
reportAny = false
|
|
83
|
+
reportCallInDefaultInitializer = true
|
|
84
|
+
reportImplicitOverride = true
|
|
85
|
+
reportImplicitStringConcatenation = true
|
|
86
|
+
reportImportCycles = true
|
|
87
|
+
reportMissingSuperCall = true
|
|
88
|
+
reportMissingTypeArgument = false
|
|
89
|
+
reportMissingTypeStubs = false
|
|
90
|
+
reportPrivateUsage = false
|
|
91
|
+
reportPropertyTypeMismatch = true
|
|
92
|
+
reportShadowedImports = true
|
|
93
|
+
reportUninitializedInstanceVariable = true
|
|
94
|
+
reportUnknownArgumentType = false
|
|
95
|
+
reportUnknownMemberType = false
|
|
96
|
+
reportUnknownParameterType = false
|
|
97
|
+
reportUnknownVariableType = false
|
|
98
|
+
reportUnnecessaryComparison = false
|
|
99
|
+
reportUnnecessaryTypeIgnoreComment = true
|
|
100
|
+
reportUnusedCallResult = true
|
|
101
|
+
reportUnusedImport = false
|
|
102
|
+
reportUnusedVariable = false
|
|
103
|
+
typeCheckingMode = "strict"
|
|
104
|
+
|
|
105
|
+
# pytest
|
|
106
|
+
[tool.pytest]
|
|
107
|
+
|
|
108
|
+
[tool.pytest.ini_options]
|
|
109
|
+
addopts = ["--color=auto", "--strict-markers", "-ra", "-vv"]
|
|
110
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
111
|
+
asyncio_mode = "auto"
|
|
112
|
+
collect_imported_tests = false
|
|
113
|
+
filterwarnings = ["error"]
|
|
114
|
+
minversion = "8.0"
|
|
115
|
+
testpaths = ["src/tests"]
|
|
116
|
+
xfail_strict = true
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# ruff
|
|
120
|
+
[tool.ruff]
|
|
121
|
+
src = ["src"]
|
|
122
|
+
target-version = "py313"
|
|
123
|
+
unsafe-fixes = true
|
|
124
|
+
|
|
125
|
+
[tool.ruff.format]
|
|
126
|
+
preview = true
|
|
127
|
+
skip-magic-trailing-comma = true
|
|
128
|
+
|
|
129
|
+
[tool.ruff.lint]
|
|
130
|
+
explicit-preview-rules = true
|
|
131
|
+
fixable = ["ALL"]
|
|
132
|
+
ignore = [
|
|
133
|
+
"ANN401", # any-type
|
|
134
|
+
"ASYNC109", # async-function-with-timeout
|
|
135
|
+
"C901", # complex-structure
|
|
136
|
+
"CPY", # flake8-copyright
|
|
137
|
+
"D", # pydocstyle
|
|
138
|
+
"DOC", # pydoclint
|
|
139
|
+
"E501", # line-too-long
|
|
140
|
+
"PD", # pandas-vet
|
|
141
|
+
"PERF203", # try-except-in-loop
|
|
142
|
+
"PLC0415", # import-outside-top-level
|
|
143
|
+
"PLR0911", # too-many-return-statements
|
|
144
|
+
"PLR0912", # too-many-branches
|
|
145
|
+
"PLR0913", # too-many-arguments
|
|
146
|
+
"PLR0915", # too-many-statements
|
|
147
|
+
"PLR2004", # magic-value-comparison
|
|
148
|
+
"PT012", # pytest-raises-with-multiple-statements
|
|
149
|
+
"PT013", # pytest-incorrect-pytest-import
|
|
150
|
+
"S202", # tarfile-unsafe-members
|
|
151
|
+
"S310", # suspicious-url-open-usage
|
|
152
|
+
"S311", # suspicious-non-cryptographic-random-usage
|
|
153
|
+
"S602", # subprocess-popen-with-shell-equals-true
|
|
154
|
+
"S603", # subprocess-without-shell-equals-true
|
|
155
|
+
"S607", # start-process-with-partial-path
|
|
156
|
+
# preview
|
|
157
|
+
"S101", # assert
|
|
158
|
+
# formatter
|
|
159
|
+
"COM812", # missing-trailing-comma
|
|
160
|
+
"COM819", # prohibited-trailing-comma
|
|
161
|
+
"E111", # indentation-with-invalid-multiple
|
|
162
|
+
"E114", # indentation-with-invalid-multiple-comment
|
|
163
|
+
"E117", # over-indented
|
|
164
|
+
"ISC001", # single-line-implicit-string-concatenation
|
|
165
|
+
"ISC002", # multi-line-implicit-string-concatenation
|
|
166
|
+
"W191", # tab-indentation
|
|
167
|
+
]
|
|
168
|
+
preview = true
|
|
169
|
+
select = [
|
|
170
|
+
"ALL",
|
|
171
|
+
"RUF022", # unsorted-dunder-all
|
|
172
|
+
]
|
|
173
|
+
|
|
174
|
+
[tool.ruff.lint.extend-per-file-ignores]
|
|
175
|
+
"*.ipynb" = [
|
|
176
|
+
"B018", # useless-expression
|
|
177
|
+
"F403", # undefined-local-with-import-star
|
|
178
|
+
"F405", # undefined-local-with-import-star-usage
|
|
179
|
+
"PLE1142", # await-outside-async
|
|
180
|
+
"S101", # assert-used
|
|
181
|
+
]
|
|
182
|
+
"src/tests/**/*.py" = [
|
|
183
|
+
"S101", # assert-used
|
|
184
|
+
]
|
|
185
|
+
|
|
186
|
+
[tool.ruff.lint.flake8-tidy-imports]
|
|
187
|
+
ban-relative-imports = "all"
|
|
188
|
+
|
|
189
|
+
[tool.ruff.lint.isort]
|
|
190
|
+
required-imports = ["from __future__ import annotations"]
|
|
191
|
+
split-on-trailing-comma = false
|
|
192
|
+
|
|
193
|
+
# uv
|
|
194
|
+
[tool.uv.build-backend]
|
|
195
|
+
module-name = "pre_commit_hooks"
|
|
196
|
+
module-root = "src"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from importlib.resources import files
|
|
4
|
+
from stat import S_IXUSR
|
|
4
5
|
from subprocess import SubprocessError, run
|
|
5
6
|
from typing import TYPE_CHECKING, cast
|
|
6
7
|
|
|
@@ -22,6 +23,7 @@ def _process() -> bool:
|
|
|
22
23
|
file = cast("Path", files("pre_commit_hooks")).joinpath(
|
|
23
24
|
"check_version_bumped", "check-version-bumped"
|
|
24
25
|
)
|
|
26
|
+
file.chmod(file.stat().st_mode | S_IXUSR)
|
|
25
27
|
try:
|
|
26
28
|
_ = run([str(file)], check=True)
|
|
27
29
|
except SubprocessError:
|
|
@@ -34,7 +34,7 @@ main() {
|
|
|
34
34
|
echo_date "'bump-my-version' or 'pip' must be available" >&2 && return 1
|
|
35
35
|
fi
|
|
36
36
|
if ! have_bump_my_version && have_command pip; then
|
|
37
|
-
pip install bump-my-version
|
|
37
|
+
pip install bump-my-version 'click >=8.2.1, <8.3'
|
|
38
38
|
fi
|
|
39
39
|
if ! have_bump_my_version; then
|
|
40
40
|
echo_date "'bump-my-version' must be available" >&2 && return 1
|
{dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/common.py
RENAMED
|
@@ -69,7 +69,7 @@ def get_version(source: Mode | Path | str | bytes | TOMLDocument, /) -> Version:
|
|
|
69
69
|
msg = f"`version` is not a string; got {get_class_name(version)!r}"
|
|
70
70
|
raise GetVersionError(msg)
|
|
71
71
|
return parse_version(version)
|
|
72
|
-
case never:
|
|
72
|
+
case never:
|
|
73
73
|
assert_never(never)
|
|
74
74
|
|
|
75
75
|
|
|
@@ -83,7 +83,7 @@ def get_toml_path(mode: Mode = DEFAULT_MODE, /) -> Path:
|
|
|
83
83
|
return Path("pyproject.toml")
|
|
84
84
|
case "bumpversion":
|
|
85
85
|
return Path(".bumpversion.toml")
|
|
86
|
-
case never:
|
|
86
|
+
case never:
|
|
87
87
|
assert_never(never)
|
|
88
88
|
|
|
89
89
|
|
|
@@ -102,7 +102,7 @@ def _tag_commit(
|
|
|
102
102
|
str_ver = str(version)
|
|
103
103
|
try:
|
|
104
104
|
existing = repo.tags[str_ver]
|
|
105
|
-
except
|
|
105
|
+
except IndexError:
|
|
106
106
|
pass
|
|
107
107
|
else:
|
|
108
108
|
repo.delete_tag(existing)
|
|
@@ -112,7 +112,11 @@ def _tag_commit(
|
|
|
112
112
|
msg = f"Failed to tag {desc}; error creating tag: {error.stderr.strip()}"
|
|
113
113
|
raise TagCommitsError(msg) from None
|
|
114
114
|
logger.info(f"Tagging {desc} as {str_ver!r}...")
|
|
115
|
-
|
|
115
|
+
try:
|
|
116
|
+
_ = repo.remotes.origin.push(f"refs/tags/{tag.name}")
|
|
117
|
+
except GitCommandError as error:
|
|
118
|
+
msg = f"Failed to tag {desc}; error pushing tag: {error.stderr.strip()}"
|
|
119
|
+
raise TagCommitsError(msg) from None
|
|
116
120
|
return True
|
|
117
121
|
|
|
118
122
|
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
# Byte-compiled / optimized / DLL files
|
|
2
|
-
__pycache__/
|
|
3
|
-
*.py[cod]
|
|
4
|
-
*$py.class
|
|
5
|
-
|
|
6
|
-
# C extensions
|
|
7
|
-
*.so
|
|
8
|
-
|
|
9
|
-
# Distribution / packaging
|
|
10
|
-
.Python
|
|
11
|
-
build/
|
|
12
|
-
develop-eggs/
|
|
13
|
-
dist/
|
|
14
|
-
downloads/
|
|
15
|
-
eggs/
|
|
16
|
-
.eggs/
|
|
17
|
-
lib/
|
|
18
|
-
lib64/
|
|
19
|
-
parts/
|
|
20
|
-
sdist/
|
|
21
|
-
var/
|
|
22
|
-
wheels/
|
|
23
|
-
share/python-wheels/
|
|
24
|
-
*.egg-info/
|
|
25
|
-
.installed.cfg
|
|
26
|
-
*.egg
|
|
27
|
-
MANIFEST
|
|
28
|
-
|
|
29
|
-
# PyInstaller
|
|
30
|
-
# Usually these files are written by a python script from a template
|
|
31
|
-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
-
*.manifest
|
|
33
|
-
*.spec
|
|
34
|
-
|
|
35
|
-
# Installer logs
|
|
36
|
-
pip-log.txt
|
|
37
|
-
pip-delete-this-directory.txt
|
|
38
|
-
|
|
39
|
-
# Unit test / coverage reports
|
|
40
|
-
htmlcov/
|
|
41
|
-
.tox/
|
|
42
|
-
.nox/
|
|
43
|
-
.coverage
|
|
44
|
-
.coverage.*
|
|
45
|
-
.cache
|
|
46
|
-
nosetests.xml
|
|
47
|
-
coverage.xml
|
|
48
|
-
*.cover
|
|
49
|
-
*.py,cover
|
|
50
|
-
.hypothesis/
|
|
51
|
-
.pytest_cache/
|
|
52
|
-
cover/
|
|
53
|
-
|
|
54
|
-
# Translations
|
|
55
|
-
*.mo
|
|
56
|
-
*.pot
|
|
57
|
-
|
|
58
|
-
# Django stuff:
|
|
59
|
-
*.log
|
|
60
|
-
local_settings.py
|
|
61
|
-
db.sqlite3
|
|
62
|
-
db.sqlite3-journal
|
|
63
|
-
|
|
64
|
-
# Flask stuff:
|
|
65
|
-
instance/
|
|
66
|
-
.webassets-cache
|
|
67
|
-
|
|
68
|
-
# Scrapy stuff:
|
|
69
|
-
.scrapy
|
|
70
|
-
|
|
71
|
-
# Sphinx documentation
|
|
72
|
-
docs/_build/
|
|
73
|
-
|
|
74
|
-
# PyBuilder
|
|
75
|
-
.pybuilder/
|
|
76
|
-
target/
|
|
77
|
-
|
|
78
|
-
# Jupyter Notebook
|
|
79
|
-
.ipynb_checkpoints
|
|
80
|
-
|
|
81
|
-
# IPython
|
|
82
|
-
profile_default/
|
|
83
|
-
ipython_config.py
|
|
84
|
-
|
|
85
|
-
# pyenv
|
|
86
|
-
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
-
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
-
# .python-version
|
|
89
|
-
|
|
90
|
-
# pipenv
|
|
91
|
-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
-
# install all needed dependencies.
|
|
95
|
-
#Pipfile.lock
|
|
96
|
-
|
|
97
|
-
# poetry
|
|
98
|
-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
99
|
-
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
-
# commonly ignored for libraries.
|
|
101
|
-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
102
|
-
#poetry.lock
|
|
103
|
-
|
|
104
|
-
# pdm
|
|
105
|
-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
106
|
-
#pdm.lock
|
|
107
|
-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
108
|
-
# in version control.
|
|
109
|
-
# https://pdm.fming.dev/#use-with-ide
|
|
110
|
-
.pdm.toml
|
|
111
|
-
|
|
112
|
-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
113
|
-
__pypackages__/
|
|
114
|
-
|
|
115
|
-
# Celery stuff
|
|
116
|
-
celerybeat-schedule
|
|
117
|
-
celerybeat.pid
|
|
118
|
-
|
|
119
|
-
# SageMath parsed files
|
|
120
|
-
*.sage.py
|
|
121
|
-
|
|
122
|
-
# Environments
|
|
123
|
-
.env
|
|
124
|
-
.venv
|
|
125
|
-
env/
|
|
126
|
-
venv/
|
|
127
|
-
ENV/
|
|
128
|
-
env.bak/
|
|
129
|
-
venv.bak/
|
|
130
|
-
|
|
131
|
-
# Spyder project settings
|
|
132
|
-
.spyderproject
|
|
133
|
-
.spyproject
|
|
134
|
-
|
|
135
|
-
# Rope project settings
|
|
136
|
-
.ropeproject
|
|
137
|
-
|
|
138
|
-
# mkdocs documentation
|
|
139
|
-
/site
|
|
140
|
-
|
|
141
|
-
# mypy
|
|
142
|
-
.mypy_cache/
|
|
143
|
-
.dmypy.json
|
|
144
|
-
dmypy.json
|
|
145
|
-
|
|
146
|
-
# Pyre type checker
|
|
147
|
-
.pyre/
|
|
148
|
-
|
|
149
|
-
# pytype static type analyzer
|
|
150
|
-
.pytype/
|
|
151
|
-
|
|
152
|
-
# Cython debug symbols
|
|
153
|
-
cython_debug/
|
|
154
|
-
|
|
155
|
-
# PyCharm
|
|
156
|
-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
157
|
-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
158
|
-
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
159
|
-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
160
|
-
#.idea/
|
|
161
|
-
|
|
162
|
-
# extra
|
|
163
|
-
.direnv/
|
|
164
|
-
.ruff_cache/
|
|
165
|
-
node_modules/
|
|
166
|
-
Untitled.ipynb
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# build-system
|
|
4
|
-
[build-system]
|
|
5
|
-
build-backend = "hatchling.build"
|
|
6
|
-
requires = ["hatchling"]
|
|
7
|
-
|
|
8
|
-
# dependency groups
|
|
9
|
-
[dependency-groups]
|
|
10
|
-
dev = [
|
|
11
|
-
"dycw-utilities[test]",
|
|
12
|
-
"pyright[nodejs]",
|
|
13
|
-
"rich",
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
# project
|
|
17
|
-
[project]
|
|
18
|
-
authors = [{name = "Derek Wan", email = "d.wan@icloud.com"}]
|
|
19
|
-
dependencies = [
|
|
20
|
-
"click >=8.3.0, <8.4",
|
|
21
|
-
"dycw-utilities >=0.168.8, <0.169",
|
|
22
|
-
"gitpython >=3.1.45, <3.2",
|
|
23
|
-
"libcst >=1.8.5, <1.9",
|
|
24
|
-
"loguru >=0.7.3, <0.8",
|
|
25
|
-
"more-itertools >=10.8.0, <10.9",
|
|
26
|
-
"orjson >=3.11.3, <3.12",
|
|
27
|
-
"packaging >=25.0, <25.1",
|
|
28
|
-
"tomlkit >=0.13.3, <0.14",
|
|
29
|
-
"xdg-base-dirs >=6.0.2, <6.1",
|
|
30
|
-
]
|
|
31
|
-
name = "dycw-pre-commit-hooks"
|
|
32
|
-
readme = "README.md"
|
|
33
|
-
requires-python = ">= 3.12"
|
|
34
|
-
version = "0.13.9"
|
|
35
|
-
|
|
36
|
-
[project.scripts]
|
|
37
|
-
check-submodules-updated = "pre_commit_hooks.check_submodules_updated:main"
|
|
38
|
-
check-version-bumped = "pre_commit_hooks.check_version_bumped:main"
|
|
39
|
-
format-requirements = "pre_commit_hooks.format_requirements:main"
|
|
40
|
-
mirror-files = "pre_commit_hooks.mirror_files:main"
|
|
41
|
-
replace-sequence-str = "pre_commit_hooks.replace_sequence_str:main"
|
|
42
|
-
run-bump-my-version = "pre_commit_hooks.run_bump_my_version:main"
|
|
43
|
-
tag-commits = "pre_commit_hooks.tag_commits:main"
|
|
44
|
-
|
|
45
|
-
# bump-my-version
|
|
46
|
-
[tool.bumpversion]
|
|
47
|
-
allow_dirty = true
|
|
48
|
-
current_version = "0.13.9"
|
|
49
|
-
|
|
50
|
-
[[tool.bumpversion.files]]
|
|
51
|
-
filename = "src/pre_commit_hooks/__init__.py"
|
|
52
|
-
replace = "__version__ = \"{new_version}\""
|
|
53
|
-
search = "__version__ = \"{current_version}\""
|
|
54
|
-
|
|
55
|
-
# coverage
|
|
56
|
-
[tool.coverage]
|
|
57
|
-
|
|
58
|
-
[tool.coverage.html]
|
|
59
|
-
directory = ".coverage/html"
|
|
60
|
-
|
|
61
|
-
[tool.coverage.report]
|
|
62
|
-
exclude_also = ["@overload", "if TYPE_CHECKING:"]
|
|
63
|
-
fail_under = 100.0
|
|
64
|
-
skip_covered = true
|
|
65
|
-
skip_empty = true
|
|
66
|
-
|
|
67
|
-
[tool.coverage.run]
|
|
68
|
-
branch = true
|
|
69
|
-
data_file = ".coverage/data"
|
|
70
|
-
parallel = true
|
|
71
|
-
|
|
72
|
-
# hatch
|
|
73
|
-
[tool.hatch]
|
|
74
|
-
|
|
75
|
-
[tool.hatch.build.targets.sdist]
|
|
76
|
-
include = ["src"]
|
|
77
|
-
|
|
78
|
-
[tool.hatch.build.targets.wheel]
|
|
79
|
-
packages = ["src/pre_commit_hooks"]
|
|
80
|
-
|
|
81
|
-
# nitpick
|
|
82
|
-
[tool.nitpick]
|
|
83
|
-
style = [
|
|
84
|
-
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/3.12.toml",
|
|
85
|
-
"https://raw.githubusercontent.com/dycw/nitpick/master/styles/common.toml",
|
|
86
|
-
]
|
|
87
|
-
|
|
88
|
-
# pyright
|
|
89
|
-
[tool.pyright]
|
|
90
|
-
deprecateTypingAliases = true
|
|
91
|
-
enableReachabilityAnalysis = false
|
|
92
|
-
ignore = ["**/_typeshed/**"]
|
|
93
|
-
pythonVersion = "3.12"
|
|
94
|
-
reportAny = false
|
|
95
|
-
reportCallInDefaultInitializer = true
|
|
96
|
-
reportImplicitOverride = true
|
|
97
|
-
reportImplicitStringConcatenation = true
|
|
98
|
-
reportImportCycles = true
|
|
99
|
-
reportMissingSuperCall = true
|
|
100
|
-
reportMissingTypeArgument = false
|
|
101
|
-
reportMissingTypeStubs = false
|
|
102
|
-
reportPrivateUsage = false
|
|
103
|
-
reportPropertyTypeMismatch = true
|
|
104
|
-
reportShadowedImports = true
|
|
105
|
-
reportUninitializedInstanceVariable = true
|
|
106
|
-
reportUnknownArgumentType = false
|
|
107
|
-
reportUnknownMemberType = false
|
|
108
|
-
reportUnknownParameterType = false
|
|
109
|
-
reportUnknownVariableType = false
|
|
110
|
-
reportUnnecessaryTypeIgnoreComment = true
|
|
111
|
-
reportUnusedCallResult = true
|
|
112
|
-
reportUnusedImport = false
|
|
113
|
-
reportUnusedVariable = false
|
|
114
|
-
typeCheckingMode = "strict"
|
|
115
|
-
|
|
116
|
-
# pytest
|
|
117
|
-
[tool.pytest]
|
|
118
|
-
|
|
119
|
-
[tool.pytest.ini_options]
|
|
120
|
-
addopts = [
|
|
121
|
-
"-ra",
|
|
122
|
-
"-vv",
|
|
123
|
-
"--color=auto",
|
|
124
|
-
"--pdbcls=pudb.debugger:Debugger",
|
|
125
|
-
"--strict-markers",
|
|
126
|
-
]
|
|
127
|
-
asyncio_default_fixture_loop_scope = "function"
|
|
128
|
-
asyncio_mode = "auto"
|
|
129
|
-
collect_imported_tests = false
|
|
130
|
-
filterwarnings = ["error"]
|
|
131
|
-
minversion = "8.0"
|
|
132
|
-
testpaths = ["src/tests"]
|
|
133
|
-
xfail_strict = true
|
|
134
|
-
|
|
135
|
-
# ruff
|
|
136
|
-
[tool.ruff]
|
|
137
|
-
src = ["src"]
|
|
138
|
-
target-version = "py312"
|
|
139
|
-
unsafe-fixes = true
|
|
140
|
-
|
|
141
|
-
[tool.ruff.format]
|
|
142
|
-
preview = true
|
|
143
|
-
skip-magic-trailing-comma = true
|
|
144
|
-
|
|
145
|
-
[tool.ruff.lint]
|
|
146
|
-
explicit-preview-rules = true
|
|
147
|
-
fixable = ["ALL"]
|
|
148
|
-
ignore = [
|
|
149
|
-
"ANN401", # any-type
|
|
150
|
-
"ASYNC109", # async-function-with-timeout
|
|
151
|
-
"C901", # complex-structure
|
|
152
|
-
"D100", # undocumented-public-module
|
|
153
|
-
"D101", # undocumented-public-class
|
|
154
|
-
"D102", # undocumented-public-method
|
|
155
|
-
"D103", # undocumented-public-function
|
|
156
|
-
"D104", # undocumented-public-package
|
|
157
|
-
"D105", # undocumented-magic-method
|
|
158
|
-
"D106", # undocumented-public-nested-class
|
|
159
|
-
"D107", # undocumented-public-init
|
|
160
|
-
"D203", # one-blank-line-before-class
|
|
161
|
-
"D213", # multi-line-summary-second-line
|
|
162
|
-
"DOC", # pydoclint
|
|
163
|
-
"E501", # line-too-long
|
|
164
|
-
"PD", # pandas-vet
|
|
165
|
-
"PERF203", # try-except-in-loop
|
|
166
|
-
"PLC0415", # import-outside-top-level
|
|
167
|
-
"PLR0911", # too-many-return-statements
|
|
168
|
-
"PLR0912", # too-many-branches
|
|
169
|
-
"PLR0913", # too-many-arguments
|
|
170
|
-
"PLR0915", # too-many-statements
|
|
171
|
-
"PLR2004", # magic-value-comparison
|
|
172
|
-
"PT012", # pytest-raises-with-multiple-statements
|
|
173
|
-
"PT013", # pytest-incorrect-pytest-import
|
|
174
|
-
"S311", # suspicious-non-cryptographic-random-usage
|
|
175
|
-
"S603", # subprocess-without-shell-equals-true
|
|
176
|
-
"S607", # start-process-with-partial-path
|
|
177
|
-
# preview
|
|
178
|
-
"S101", # assert
|
|
179
|
-
# formatter
|
|
180
|
-
"W191", # tab-indentation
|
|
181
|
-
"E111", # indentation-with-invalid-multiple
|
|
182
|
-
"E114", # indentation-with-invalid-multiple-comment
|
|
183
|
-
"E117", # over-indented
|
|
184
|
-
"D206", # indent-with-spaces
|
|
185
|
-
"D300", # triple-single-quotes
|
|
186
|
-
"Q000", # bad-quotes-inline-string
|
|
187
|
-
"Q001", # bad-quotes-multiline-string
|
|
188
|
-
"Q002", # bad-quotes-docstring
|
|
189
|
-
"Q003", # avoidable-escaped-quote
|
|
190
|
-
"COM812", # missing-trailing-comma
|
|
191
|
-
"COM819", # prohibited-trailing-comma
|
|
192
|
-
"ISC001", # single-line-implicit-string-concatenation
|
|
193
|
-
"ISC002", # multi-line-implicit-string-concatenation
|
|
194
|
-
]
|
|
195
|
-
preview = true
|
|
196
|
-
select = [
|
|
197
|
-
"ALL",
|
|
198
|
-
"RUF022", # unsorted-dunder-all
|
|
199
|
-
]
|
|
200
|
-
|
|
201
|
-
[tool.ruff.lint.extend-per-file-ignores]
|
|
202
|
-
"*.ipynb" = [
|
|
203
|
-
"B018", # useless-expression
|
|
204
|
-
"F403", # undefined-local-with-import-star
|
|
205
|
-
"F405", # undefined-local-with-import-star-usage
|
|
206
|
-
"PLE1142", # await-outside-async
|
|
207
|
-
"S101", # assert-used
|
|
208
|
-
]
|
|
209
|
-
"src/tests/**/*.py" = [
|
|
210
|
-
"S101", # assert-used
|
|
211
|
-
]
|
|
212
|
-
|
|
213
|
-
[tool.ruff.lint.flake8-tidy-imports]
|
|
214
|
-
ban-relative-imports = "all"
|
|
215
|
-
|
|
216
|
-
[tool.ruff.lint.isort]
|
|
217
|
-
required-imports = ["from __future__ import annotations"]
|
|
218
|
-
split-on-trailing-comma = false
|
|
File without changes
|
|
File without changes
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
[dependency-groups]
|
|
2
|
-
group = [
|
|
3
|
-
"unbounded",
|
|
4
|
-
"lower>=1.2.3",
|
|
5
|
-
"upper<1.3",
|
|
6
|
-
"lower-and-upper1>=1.2.3,<1.3",
|
|
7
|
-
]
|
|
8
|
-
|
|
9
|
-
[project]
|
|
10
|
-
dependencies = [
|
|
11
|
-
"unbounded",
|
|
12
|
-
"lower1>=1.2.3",
|
|
13
|
-
"lower2 >= 1.2.3",
|
|
14
|
-
"upper1<1.3",
|
|
15
|
-
"upper2 < 1.3",
|
|
16
|
-
"lower-and-upper1>=1.2.3,<1.3",
|
|
17
|
-
"lower-and-upper2<1.3,>=1.2.3",
|
|
18
|
-
"lower-and-upper3 >= 1.2.3 , <1.3",
|
|
19
|
-
"with-extra[extra]",
|
|
20
|
-
"with-extra[extra]>=1.2.3",
|
|
21
|
-
"with-extra[extra] >= 1.2.3",
|
|
22
|
-
]
|
|
23
|
-
|
|
24
|
-
[project.optional-dependencies]
|
|
25
|
-
group = [
|
|
26
|
-
"unbounded",
|
|
27
|
-
"lower>=1.2.3",
|
|
28
|
-
"upper<1.3",
|
|
29
|
-
"lower-and-upper1>=1.2.3,<1.3",
|
|
30
|
-
]
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
[dependency-groups]
|
|
2
|
-
group = [
|
|
3
|
-
"unbounded",
|
|
4
|
-
"lower >=1.2.3",
|
|
5
|
-
"upper <1.3",
|
|
6
|
-
"lower-and-upper1 >=1.2.3, <1.3",
|
|
7
|
-
]
|
|
8
|
-
|
|
9
|
-
[project]
|
|
10
|
-
dependencies = [
|
|
11
|
-
"unbounded",
|
|
12
|
-
"lower1 >=1.2.3",
|
|
13
|
-
"lower2 >=1.2.3",
|
|
14
|
-
"upper1 <1.3",
|
|
15
|
-
"upper2 <1.3",
|
|
16
|
-
"lower-and-upper1 >=1.2.3, <1.3",
|
|
17
|
-
"lower-and-upper2 >=1.2.3, <1.3",
|
|
18
|
-
"lower-and-upper3 >=1.2.3, <1.3",
|
|
19
|
-
"with-extra[extra]",
|
|
20
|
-
"with-extra[extra] >=1.2.3",
|
|
21
|
-
"with-extra[extra] >=1.2.3",
|
|
22
|
-
]
|
|
23
|
-
|
|
24
|
-
[project.optional-dependencies]
|
|
25
|
-
group = [
|
|
26
|
-
"unbounded",
|
|
27
|
-
"lower >=1.2.3",
|
|
28
|
-
"upper <1.3",
|
|
29
|
-
"lower-and-upper1 >=1.2.3, <1.3",
|
|
30
|
-
]
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
|
|
5
|
-
from tomlkit import dumps
|
|
6
|
-
|
|
7
|
-
from pre_commit_hooks.format_requirements import _format_path
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class TestFormatRequirements:
|
|
11
|
-
def test_basic(self) -> None:
|
|
12
|
-
root = Path(__file__).parent
|
|
13
|
-
result = dumps(_format_path(root.joinpath("in.toml")))
|
|
14
|
-
expected = root.joinpath("out.toml").read_text()
|
|
15
|
-
assert result == expected
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dycw_pre_commit_hooks-0.13.9 → dycw_pre_commit_hooks-0.13.22}/src/pre_commit_hooks/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|