conventional-pre-commit 3.3.0__tar.gz → 3.5.0__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.
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.pre-commit-config.yaml +4 -4
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/PKG-INFO +1 -1
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit/format.py +11 -7
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit.egg-info/PKG-INFO +1 -1
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/run.sh +1 -1
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/test_format.py +254 -50
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/test_hook.py +30 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.devcontainer/Dockerfile +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.devcontainer/compose.yml +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.devcontainer/devcontainer.json +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.dockerignore +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.flake8 +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.github/dependabot.yaml +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.github/workflows/release.yml +10 -10
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.github/workflows/tests.yml +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.gitignore +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.pre-commit-hooks.yaml +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.vscode/settings.json +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/LICENSE +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/README.md +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit/__init__.py +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit/hook.py +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit.egg-info/SOURCES.txt +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit.egg-info/dependency_links.txt +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit.egg-info/entry_points.txt +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit.egg-info/requires.txt +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit.egg-info/top_level.txt +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/pyproject.toml +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/setup.cfg +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/__init__.py +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/conftest.py +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/bad_commit +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/conventional_commit +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/conventional_commit_bad_multi_line +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/conventional_commit_gbk +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/conventional_commit_multi_line +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/conventional_commit_utf-8 +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/conventional_commit_with_multiple_scopes +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/conventional_commit_with_scope +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/custom_commit +0 -0
- {conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/fixup_commit +0 -0
|
@@ -8,7 +8,7 @@ default_install_hook_types:
|
|
|
8
8
|
|
|
9
9
|
repos:
|
|
10
10
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
11
|
-
rev:
|
|
11
|
+
rev: v5.0.0
|
|
12
12
|
hooks:
|
|
13
13
|
- id: trailing-whitespace
|
|
14
14
|
- id: mixed-line-ending
|
|
@@ -18,21 +18,21 @@ repos:
|
|
|
18
18
|
- id: check-added-large-files
|
|
19
19
|
|
|
20
20
|
- repo: https://github.com/psf/black
|
|
21
|
-
rev: 24.
|
|
21
|
+
rev: 24.10.0
|
|
22
22
|
hooks:
|
|
23
23
|
- id: black
|
|
24
24
|
types:
|
|
25
25
|
- python
|
|
26
26
|
|
|
27
27
|
- repo: https://github.com/PyCQA/flake8
|
|
28
|
-
rev: 7.1.
|
|
28
|
+
rev: 7.1.1
|
|
29
29
|
hooks:
|
|
30
30
|
- id: flake8
|
|
31
31
|
types:
|
|
32
32
|
- python
|
|
33
33
|
|
|
34
34
|
- repo: https://github.com/pycqa/bandit
|
|
35
|
-
rev: 1.7.
|
|
35
|
+
rev: 1.7.10
|
|
36
36
|
hooks:
|
|
37
37
|
- id: bandit
|
|
38
38
|
args: ["-ll"]
|
{conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit/format.py
RENAMED
|
@@ -39,7 +39,10 @@ def r_scope(optional=True, scopes: Optional[List[str]] = None):
|
|
|
39
39
|
|
|
40
40
|
if scopes:
|
|
41
41
|
scopes_pattern = _get_scope_pattern(scopes)
|
|
42
|
-
|
|
42
|
+
if optional:
|
|
43
|
+
return f"(?:{scopes_pattern})?"
|
|
44
|
+
else:
|
|
45
|
+
return scopes_pattern
|
|
43
46
|
|
|
44
47
|
if optional:
|
|
45
48
|
return r"(\([\w \/:,-]+\))?"
|
|
@@ -67,13 +70,14 @@ def r_autosquash_prefixes():
|
|
|
67
70
|
return "|".join(AUTOSQUASH_PREFIXES)
|
|
68
71
|
|
|
69
72
|
|
|
70
|
-
def
|
|
71
|
-
"""Regex str for verbose
|
|
72
|
-
return r"
|
|
73
|
+
def r_verbose_commit_ignored():
|
|
74
|
+
"""Regex str for the ignored part of verbose commit message templates"""
|
|
75
|
+
return r"^# -{24} >8 -{24}\r?\n.*\Z"
|
|
73
76
|
|
|
74
77
|
|
|
75
|
-
def
|
|
76
|
-
|
|
78
|
+
def strip_verbose_commit_ignored(input):
|
|
79
|
+
"""Strip the ignored part of verbose commit message templates."""
|
|
80
|
+
return re.sub(r_verbose_commit_ignored(), "", input, flags=re.DOTALL | re.MULTILINE)
|
|
77
81
|
|
|
78
82
|
|
|
79
83
|
def r_comment():
|
|
@@ -99,7 +103,7 @@ def is_conventional(input, types=DEFAULT_TYPES, optional_scope=True, scopes: Opt
|
|
|
99
103
|
|
|
100
104
|
Optionally provide a list of additional custom types.
|
|
101
105
|
"""
|
|
102
|
-
input =
|
|
106
|
+
input = strip_verbose_commit_ignored(input)
|
|
103
107
|
input = strip_comments(input)
|
|
104
108
|
types = conventional_types(types)
|
|
105
109
|
pattern = f"^({r_types(types)}){r_scope(optional_scope, scopes=scopes)}{r_delim()}{r_subject()}{r_body()}"
|
|
@@ -66,7 +66,7 @@ def test_r_scope__special_chars():
|
|
|
66
66
|
|
|
67
67
|
def test_r_scope__scopes():
|
|
68
68
|
scopes_input = ["api", "client"]
|
|
69
|
-
result = format.r_scope(scopes=scopes_input)
|
|
69
|
+
result = format.r_scope(scopes=scopes_input, optional=False)
|
|
70
70
|
regex = re.compile(result)
|
|
71
71
|
assert regex.match("(api)")
|
|
72
72
|
assert regex.match("(client)")
|
|
@@ -165,71 +165,275 @@ def test_strip_comments__spaced():
|
|
|
165
165
|
assert result.strip() == "feat(scope): message"
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
def
|
|
169
|
-
regex = re.compile(format.
|
|
170
|
-
input = """
|
|
171
|
-
#
|
|
172
|
-
#
|
|
173
|
-
|
|
168
|
+
def test_r_verbose_commit_ignored__does_not_match_no_verbose():
|
|
169
|
+
regex = re.compile(format.r_verbose_commit_ignored(), re.DOTALL | re.MULTILINE)
|
|
170
|
+
input = """feat: some commit message
|
|
171
|
+
# Please enter the commit message for your changes. Lines starting
|
|
172
|
+
# with '#' will be ignored, and an empty message aborts the commit.
|
|
173
|
+
#
|
|
174
|
+
# On branch main
|
|
175
|
+
# Your branch is up to date with 'origin/main'.
|
|
176
|
+
#
|
|
177
|
+
# Changes to be committed:
|
|
178
|
+
# modified: README.md
|
|
179
|
+
#
|
|
180
|
+
# Changes not staged for commit:
|
|
181
|
+
# modified: README.md
|
|
182
|
+
#
|
|
174
183
|
"""
|
|
175
184
|
|
|
176
|
-
assert regex.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
def
|
|
180
|
-
regex = re.compile(format.
|
|
181
|
-
input =
|
|
182
|
-
|
|
183
|
-
#
|
|
185
|
+
assert not regex.search(input)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def test_r_verbose_commit_ignored__matches_single_verbose_ignored():
|
|
189
|
+
regex = re.compile(format.r_verbose_commit_ignored(), re.DOTALL | re.MULTILINE)
|
|
190
|
+
input = (
|
|
191
|
+
"""feat: some commit message
|
|
192
|
+
# Please enter the commit message for your changes. Lines starting
|
|
193
|
+
# with '#' will be ignored, and an empty message aborts the commit.
|
|
194
|
+
#
|
|
195
|
+
# On branch main
|
|
196
|
+
# Your branch is up to date with 'origin/main'.
|
|
197
|
+
#
|
|
198
|
+
# Changes to be committed:
|
|
199
|
+
# modified: README.md
|
|
200
|
+
#
|
|
201
|
+
# Changes not staged for commit:
|
|
202
|
+
# modified: README.md
|
|
203
|
+
#
|
|
204
|
+
# ------------------------ >8 ------------------------
|
|
205
|
+
# Do not modify or remove the line above.
|
|
206
|
+
# Everything below it will be ignored.
|
|
207
|
+
diff --git c/README.md i/README.md
|
|
208
|
+
index ea80a93..fe8a527 100644
|
|
209
|
+
--- c/README.md
|
|
210
|
+
+++ i/README.md
|
|
211
|
+
@@ -20,3 +20,4 @@ Some hunk header
|
|
212
|
+
Context 1
|
|
184
213
|
"""
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
def test_r_verbose_diff__no_extra_comments():
|
|
190
|
-
regex = re.compile(format.r_verbose_diff(), re.MULTILINE)
|
|
191
|
-
input = """# ----------- >8 -----------
|
|
192
|
-
diff --git a/file b/file
|
|
214
|
+
+ " " # This is on purpose to preserve the space from overly eager stripping.
|
|
215
|
+
+ """
|
|
216
|
+
Context 2
|
|
217
|
+
+Added line
|
|
193
218
|
"""
|
|
219
|
+
)
|
|
194
220
|
|
|
195
|
-
assert
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
def
|
|
199
|
-
|
|
200
|
-
|
|
221
|
+
assert regex.search(input)
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def test_r_verbose_commit_ignored__matches_double_verbose_ignored():
|
|
225
|
+
regex = re.compile(format.r_verbose_commit_ignored(), re.DOTALL | re.MULTILINE)
|
|
226
|
+
input = (
|
|
227
|
+
"""feat: some commit message
|
|
228
|
+
# Please enter the commit message for your changes. Lines starting
|
|
229
|
+
# with '#' will be ignored, and an empty message aborts the commit.
|
|
230
|
+
#
|
|
231
|
+
# On branch main
|
|
232
|
+
# Your branch is up to date with 'origin/main'.
|
|
233
|
+
#
|
|
234
|
+
# Changes to be committed:
|
|
235
|
+
# modified: README.md
|
|
236
|
+
#
|
|
237
|
+
# Changes not staged for commit:
|
|
238
|
+
# modified: README.md
|
|
239
|
+
#
|
|
240
|
+
# ------------------------ >8 ------------------------
|
|
241
|
+
# Do not modify or remove the line above.
|
|
242
|
+
# Everything below it will be ignored.
|
|
243
|
+
#
|
|
244
|
+
# Changes to be committed:
|
|
245
|
+
diff --git c/README.md i/README.md
|
|
246
|
+
index ea80a93..fe8a527 100644
|
|
247
|
+
--- c/README.md
|
|
248
|
+
+++ i/README.md
|
|
249
|
+
@@ -20,3 +20,4 @@ Some staged hunk header
|
|
250
|
+
Staged Context 1
|
|
251
|
+
"""
|
|
252
|
+
+ " " # This is on purpose to preserve the space from overly eager stripping.
|
|
253
|
+
+ """
|
|
254
|
+
Staged Context 2
|
|
255
|
+
+Staged added line
|
|
256
|
+
# --------------------------------------------------
|
|
257
|
+
# Changes not staged for commit:
|
|
258
|
+
diff --git i/README.md w/README.md
|
|
259
|
+
index fe8a527..1c00c14 100644
|
|
260
|
+
--- i/README.md
|
|
261
|
+
+++ w/README.md
|
|
262
|
+
@@ -10,6 +10,7 @@ Some unstaged hunk header
|
|
263
|
+
Context 1
|
|
264
|
+
Context 2
|
|
265
|
+
Context 3
|
|
266
|
+
-Removed line
|
|
267
|
+
+Added line
|
|
268
|
+
"""
|
|
269
|
+
+ " " # This is on purpose to preserve the space from overly eager stripping.
|
|
270
|
+
+ """
|
|
271
|
+
Context 4
|
|
272
|
+
"""
|
|
273
|
+
+ " " # This is on purpose to preserve the space from overly eager stripping.
|
|
274
|
+
+ """
|
|
275
|
+
"""
|
|
276
|
+
)
|
|
201
277
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
278
|
+
assert regex.search(input)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def test_strip_verbose_commit_ignored__does_not_strip_no_verbose():
|
|
282
|
+
input = """feat: some commit message
|
|
283
|
+
# Please enter the commit message for your changes. Lines starting
|
|
284
|
+
# with '#' will be ignored, and an empty message aborts the commit.
|
|
285
|
+
#
|
|
286
|
+
# On branch main
|
|
287
|
+
# Your branch is up to date with 'origin/main'.
|
|
288
|
+
#
|
|
289
|
+
# Changes to be committed:
|
|
290
|
+
# modified: README.md
|
|
291
|
+
#
|
|
292
|
+
# Changes not staged for commit:
|
|
293
|
+
# modified: README.md
|
|
294
|
+
#
|
|
207
295
|
"""
|
|
208
296
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
#
|
|
297
|
+
expected = """feat: some commit message
|
|
298
|
+
# Please enter the commit message for your changes. Lines starting
|
|
299
|
+
# with '#' will be ignored, and an empty message aborts the commit.
|
|
300
|
+
#
|
|
301
|
+
# On branch main
|
|
302
|
+
# Your branch is up to date with 'origin/main'.
|
|
303
|
+
#
|
|
304
|
+
# Changes to be committed:
|
|
305
|
+
# modified: README.md
|
|
306
|
+
#
|
|
307
|
+
# Changes not staged for commit:
|
|
308
|
+
# modified: README.md
|
|
309
|
+
#
|
|
310
|
+
"""
|
|
215
311
|
|
|
216
|
-
|
|
312
|
+
result = format.strip_verbose_commit_ignored(input)
|
|
313
|
+
assert result == expected
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
def test_strip_verbose_commit_ignored__strips_single_verbose_ignored():
|
|
317
|
+
input = (
|
|
318
|
+
"""feat: some commit message
|
|
319
|
+
# Please enter the commit message for your changes. Lines starting
|
|
320
|
+
# with '#' will be ignored, and an empty message aborts the commit.
|
|
321
|
+
#
|
|
322
|
+
# On branch main
|
|
323
|
+
# Your branch is up to date with 'origin/main'.
|
|
324
|
+
#
|
|
325
|
+
# Changes to be committed:
|
|
326
|
+
# modified: README.md
|
|
327
|
+
#
|
|
328
|
+
# Changes not staged for commit:
|
|
329
|
+
# modified: README.md
|
|
330
|
+
#
|
|
331
|
+
# ------------------------ >8 ------------------------
|
|
332
|
+
# Do not modify or remove the line above.
|
|
333
|
+
# Everything below it will be ignored.
|
|
334
|
+
diff --git c/README.md i/README.md
|
|
335
|
+
index ea80a93..fe8a527 100644
|
|
336
|
+
--- c/README.md
|
|
337
|
+
+++ i/README.md
|
|
338
|
+
@@ -20,3 +20,4 @@ Some hunk header
|
|
339
|
+
Context 1
|
|
340
|
+
"""
|
|
341
|
+
+ " " # This is on purpose to preserve the space from overly eager stripping.
|
|
342
|
+
+ """
|
|
343
|
+
Context 2
|
|
344
|
+
+Added line
|
|
217
345
|
"""
|
|
218
346
|
)
|
|
219
347
|
|
|
348
|
+
expected = """feat: some commit message
|
|
349
|
+
# Please enter the commit message for your changes. Lines starting
|
|
350
|
+
# with '#' will be ignored, and an empty message aborts the commit.
|
|
351
|
+
#
|
|
352
|
+
# On branch main
|
|
353
|
+
# Your branch is up to date with 'origin/main'.
|
|
354
|
+
#
|
|
355
|
+
# Changes to be committed:
|
|
356
|
+
# modified: README.md
|
|
357
|
+
#
|
|
358
|
+
# Changes not staged for commit:
|
|
359
|
+
# modified: README.md
|
|
360
|
+
#
|
|
361
|
+
"""
|
|
220
362
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
363
|
+
result = format.strip_verbose_commit_ignored(input)
|
|
364
|
+
assert result == expected
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
def test_strip_verbose_commit_ignored__strips_double_verbose_ignored():
|
|
368
|
+
input = (
|
|
369
|
+
"""feat: some commit message
|
|
370
|
+
# Please enter the commit message for your changes. Lines starting
|
|
371
|
+
# with '#' will be ignored, and an empty message aborts the commit.
|
|
372
|
+
#
|
|
373
|
+
# On branch main
|
|
374
|
+
# Your branch is up to date with 'origin/main'.
|
|
375
|
+
#
|
|
376
|
+
# Changes to be committed:
|
|
377
|
+
# modified: README.md
|
|
378
|
+
#
|
|
379
|
+
# Changes not staged for commit:
|
|
380
|
+
# modified: README.md
|
|
381
|
+
#
|
|
382
|
+
# ------------------------ >8 ------------------------
|
|
383
|
+
# Do not modify or remove the line above.
|
|
384
|
+
# Everything below it will be ignored.
|
|
385
|
+
#
|
|
386
|
+
# Changes to be committed:
|
|
387
|
+
diff --git c/README.md i/README.md
|
|
388
|
+
index ea80a93..fe8a527 100644
|
|
389
|
+
--- c/README.md
|
|
390
|
+
+++ i/README.md
|
|
391
|
+
@@ -20,3 +20,4 @@ Some staged hunk header
|
|
392
|
+
Staged Context 1
|
|
393
|
+
"""
|
|
394
|
+
+ " " # This is on purpose to preserve the space from overly eager stripping.
|
|
395
|
+
+ """
|
|
396
|
+
Staged Context 2
|
|
397
|
+
+Staged added line
|
|
398
|
+
# --------------------------------------------------
|
|
399
|
+
# Changes not staged for commit:
|
|
400
|
+
diff --git i/README.md w/README.md
|
|
401
|
+
index fe8a527..1c00c14 100644
|
|
402
|
+
--- i/README.md
|
|
403
|
+
+++ w/README.md
|
|
404
|
+
@@ -10,6 +10,7 @@ Some unstaged hunk header
|
|
405
|
+
Context 1
|
|
406
|
+
Context 2
|
|
407
|
+
Context 3
|
|
408
|
+
-Removed line
|
|
409
|
+
+Added line
|
|
410
|
+
"""
|
|
411
|
+
+ " " # This is on purpose to preserve the space from overly eager stripping.
|
|
412
|
+
+ """
|
|
413
|
+
Context 4
|
|
414
|
+
"""
|
|
415
|
+
+ " " # This is on purpose to preserve the space from overly eager stripping.
|
|
416
|
+
+ """
|
|
417
|
+
"""
|
|
418
|
+
)
|
|
224
419
|
|
|
225
|
-
|
|
226
|
-
#
|
|
227
|
-
#
|
|
228
|
-
#
|
|
420
|
+
expected = """feat: some commit message
|
|
421
|
+
# Please enter the commit message for your changes. Lines starting
|
|
422
|
+
# with '#' will be ignored, and an empty message aborts the commit.
|
|
423
|
+
#
|
|
424
|
+
# On branch main
|
|
425
|
+
# Your branch is up to date with 'origin/main'.
|
|
426
|
+
#
|
|
427
|
+
# Changes to be committed:
|
|
428
|
+
# modified: README.md
|
|
429
|
+
#
|
|
430
|
+
# Changes not staged for commit:
|
|
431
|
+
# modified: README.md
|
|
432
|
+
#
|
|
229
433
|
"""
|
|
230
434
|
|
|
231
|
-
result = format.
|
|
232
|
-
assert result ==
|
|
435
|
+
result = format.strip_verbose_commit_ignored(input)
|
|
436
|
+
assert result == expected
|
|
233
437
|
|
|
234
438
|
|
|
235
439
|
@pytest.mark.parametrize("type", format.DEFAULT_TYPES)
|
|
@@ -152,6 +152,36 @@ def test_subprocess_fail__conventional_with_multiple_scopes(cmd, conventional_co
|
|
|
152
152
|
assert result == RESULT_FAIL
|
|
153
153
|
|
|
154
154
|
|
|
155
|
+
def test_main_success__custom_scopes_optional_scope(conventional_commit_path):
|
|
156
|
+
result = main(["--scopes", "api,client", conventional_commit_path])
|
|
157
|
+
assert result == RESULT_SUCCESS
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def test_main_success__custom_scopes_with_allowed_scope(conventional_commit_with_multiple_scopes_path):
|
|
161
|
+
result = main(["--scopes", "chore,api,client", conventional_commit_with_multiple_scopes_path])
|
|
162
|
+
assert result == RESULT_SUCCESS
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def test_main_fail__custom_scopes_with_disallowed_scope(conventional_commit_with_scope_path):
|
|
166
|
+
result = main(["--scopes", "api,client", conventional_commit_with_scope_path])
|
|
167
|
+
assert result == RESULT_FAIL
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def test_main_fail__custom_scopes_require_scope_no_scope(conventional_commit_path):
|
|
171
|
+
result = main(["--scopes", "chore,feat,fix,custom", "--force-scope", conventional_commit_path])
|
|
172
|
+
assert result == RESULT_FAIL
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def test_main_success__custom_scopes_require_scope_with_allowed_scope(conventional_commit_with_scope_path):
|
|
176
|
+
result = main(["--scopes", "api,client,scope", "--force-scope", conventional_commit_with_scope_path])
|
|
177
|
+
assert result == RESULT_SUCCESS
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def test_main_fail__custom_scopes_require_scope_with_disallowed_scope(conventional_commit_with_scope_path):
|
|
181
|
+
result = main(["--scopes", "api,client", "--force-scope", conventional_commit_with_scope_path])
|
|
182
|
+
assert result == RESULT_FAIL
|
|
183
|
+
|
|
184
|
+
|
|
155
185
|
def test_subprocess_success__fixup_commit(cmd, fixup_commit_path):
|
|
156
186
|
result = subprocess.call((cmd, fixup_commit_path))
|
|
157
187
|
|
|
File without changes
|
|
File without changes
|
{conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.devcontainer/devcontainer.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/.github/workflows/release.yml
RENAMED
|
@@ -36,16 +36,6 @@ jobs:
|
|
|
36
36
|
- name: Build package
|
|
37
37
|
run: python -m build
|
|
38
38
|
|
|
39
|
-
- name: Release
|
|
40
|
-
id: release
|
|
41
|
-
uses: softprops/action-gh-release@v2
|
|
42
|
-
with:
|
|
43
|
-
files: |
|
|
44
|
-
./dist/*.whl
|
|
45
|
-
./dist/*.tar.gz
|
|
46
|
-
prerelease: ${{ contains(github.ref, '-pre') }}
|
|
47
|
-
generate_release_notes: ${{ !contains(github.ref, '-pre') }}
|
|
48
|
-
|
|
49
39
|
- name: Publish to Test PyPI
|
|
50
40
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
51
41
|
if: ${{ contains(github.ref, '-pre') }}
|
|
@@ -60,3 +50,13 @@ jobs:
|
|
|
60
50
|
if: ${{ !contains(github.ref, '-pre') }}
|
|
61
51
|
with:
|
|
62
52
|
print-hash: true
|
|
53
|
+
|
|
54
|
+
- name: Release
|
|
55
|
+
id: release
|
|
56
|
+
uses: softprops/action-gh-release@v2
|
|
57
|
+
with:
|
|
58
|
+
files: |
|
|
59
|
+
./dist/*.whl
|
|
60
|
+
./dist/*.tar.gz
|
|
61
|
+
prerelease: ${{ contains(github.ref, '-pre') }}
|
|
62
|
+
generate_release_notes: ${{ !contains(github.ref, '-pre') }}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit/__init__.py
RENAMED
|
File without changes
|
{conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/conventional_pre_commit/hook.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
{conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/conventional_commit
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{conventional_pre_commit-3.3.0 → conventional_pre_commit-3.5.0}/tests/messages/custom_commit
RENAMED
|
File without changes
|
|
File without changes
|