pre-commit-crocodile 4.0.0__tar.gz → 4.2.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.
Files changed (105) hide show
  1. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.gitlab-ci.yml +5 -3
  2. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.pre-commit-config.yaml +5 -1
  3. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/CHANGELOG.md +57 -0
  4. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/LICENSE +1 -1
  5. {pre_commit_crocodile-4.0.0/pre_commit_crocodile.egg-info → pre_commit_crocodile-4.2.0}/PKG-INFO +16 -3
  6. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/README.md +1 -1
  7. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/prepare.sh +2 -1
  8. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/mkdocs.yml +1 -1
  9. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0/pre_commit_crocodile.egg-info}/PKG-INFO +16 -3
  10. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/setup.py +1 -1
  11. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/sonar-project.properties +3 -0
  12. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/assets/.pre-commit-config.yaml +4 -0
  13. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/cli/entrypoint.py +10 -5
  14. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/features/precommit.py +44 -17
  15. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/hooks/configurations.py +34 -1
  16. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/hooks/prepare_commit_message.py +1 -1
  17. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/prints/colors.py +1 -1
  18. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/templates/commits.yml +5 -3
  19. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.coveragerc +0 -0
  20. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.cz.yaml +0 -0
  21. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.gitattributes +0 -0
  22. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.gitignore +0 -0
  23. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.markdownlint.json +0 -0
  24. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.pre-commit-hooks.yaml +0 -0
  25. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.style.yapf +0 -0
  26. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.vscode/extensions.json +0 -0
  27. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/.vscode/settings.json +0 -0
  28. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/config/cliff.toml +0 -0
  29. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/containers/build/Dockerfile +0 -0
  30. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/containers/codestyle/Dockerfile +0 -0
  31. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/containers/commits/Dockerfile +0 -0
  32. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/containers/deploy/Dockerfile +0 -0
  33. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/containers/pages/Dockerfile +0 -0
  34. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/containers/preview/Dockerfile +0 -0
  35. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/containers/rehost/images.txt +0 -0
  36. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/containers/test-coverage-linux/Dockerfile +0 -0
  37. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/containers/test-coverage-windows/Dockerfile +0 -0
  38. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/containers/test-linux/Dockerfile +0 -0
  39. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/.pages.in +0 -0
  40. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/assets/images/favicon.png +0 -0
  41. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/assets/scripts/mkdocs-exporter.js +0 -0
  42. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/assets/stylesheets/custom.css +0 -0
  43. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/assets/stylesheets/pdf.scss +0 -0
  44. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/commitizen.md +0 -0
  45. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/commits.md +0 -0
  46. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/components.md +0 -0
  47. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/hooks.md +0 -0
  48. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/pre-commit.md +0 -0
  49. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/preview.py +0 -0
  50. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/preview.svg +0 -0
  51. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/robots.txt +0 -0
  52. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/settings.md +0 -0
  53. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/template.svg +0 -0
  54. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/templates/covers/back.html.j2 +0 -0
  55. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/docs/templates/covers/front.html.j2 +0 -0
  56. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/mypy.ini +0 -0
  57. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/pre_commit_crocodile.egg-info/SOURCES.txt +0 -0
  58. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/pre_commit_crocodile.egg-info/dependency_links.txt +0 -0
  59. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/pre_commit_crocodile.egg-info/entry_points.txt +0 -0
  60. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/pre_commit_crocodile.egg-info/requires.txt +0 -0
  61. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/pre_commit_crocodile.egg-info/top_level.txt +0 -0
  62. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/requirements/build.txt +0 -0
  63. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/requirements/commits.txt +0 -0
  64. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/requirements/coverage.txt +0 -0
  65. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/requirements/deploy.txt +0 -0
  66. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/requirements/docs.txt +0 -0
  67. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/requirements/pages.txt +0 -0
  68. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/requirements/quality.txt +0 -0
  69. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/requirements/runtime.txt +0 -0
  70. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/requirements/tests.txt +0 -0
  71. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/setup.cfg +0 -0
  72. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/__init__.py +0 -0
  73. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/__main__.py +0 -0
  74. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/assets/.cz.yaml +0 -0
  75. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/assets/__init__.py +0 -0
  76. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/cli/__init__.py +0 -0
  77. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/cli/main.py +0 -0
  78. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/features/__init__.py +0 -0
  79. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/features/argcomplete.py +0 -0
  80. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/features/commitizen.py +0 -0
  81. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/features/gcil.py +0 -0
  82. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/features/git.py +0 -0
  83. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/features/radiandevcore.py +0 -0
  84. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/features/readme.py +0 -0
  85. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/hooks/__init__.py +0 -0
  86. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/hooks/check_yaml_ruamel_pure.py +0 -0
  87. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/package/__init__.py +0 -0
  88. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/package/bundle.py +0 -0
  89. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/package/settings.py +0 -0
  90. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/package/updates.py +0 -0
  91. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/package/version.py +0 -0
  92. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/prints/__init__.py +0 -0
  93. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/prints/boxes.py +0 -0
  94. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/system/__init__.py +0 -0
  95. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/system/commands.py +0 -0
  96. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/system/platform.py +0 -0
  97. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/types/__init__.py +0 -0
  98. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/types/environments.py +0 -0
  99. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/src/types/strings.py +0 -0
  100. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/tests/arguments/test.sh +0 -0
  101. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/tests/colors/test.sh +0 -0
  102. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/tests/macos/test.sh +0 -0
  103. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/tests/settings/test.sh +0 -0
  104. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/tests/versions/test.sh +0 -0
  105. {pre_commit_crocodile-4.0.0 → pre_commit_crocodile-4.2.0}/tests/windows/test.sh +0 -0
@@ -68,7 +68,7 @@ changelog:
68
68
  sed -i "s#raw/[^/]*/docs#raw/${tag}/docs#g" ./README.md
69
69
  git add -v ./CHANGELOG.md ./README.md
70
70
  echo ' '
71
- git commit -m "docs(changelog): regenerate release tag changes history" -s
71
+ git commit -m "docs(changelog): release version ${tag} and refresh changes history" -s
72
72
  echo ' '
73
73
  # Create release tag
74
74
  - git tag -f -m "${tag}" "${tag}"
@@ -741,6 +741,7 @@ readme:
741
741
  changes:
742
742
  - 'CHANGELOG.md'
743
743
  - 'requirements/**/*'
744
+ - 'sonar-project.properties'
744
745
  - 'src/**/*'
745
746
  - 'tests/**/*'
746
747
  - if: $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "trigger" || $CI_PIPELINE_SOURCE == "web" || $CI_COMMIT_REF_NAME != $CI_DEFAULT_BRANCH
@@ -842,6 +843,7 @@ sonarcloud:
842
843
  changes:
843
844
  - 'CHANGELOG.md'
844
845
  - 'requirements/**/*'
846
+ - 'sonar-project.properties'
845
847
  - 'src/**/*'
846
848
  - 'tests/**/*'
847
849
  when: always
@@ -996,7 +998,7 @@ pages:
996
998
  # Prepare documentation
997
999
  - |
998
1000
  if [ ! -z "${CI_LOCAL:-}" ]; then
999
- find ./.cz.yaml ./config/* ./docs/* ./mkdocs.yml ./README.md -not -path ./docs/assets/stylesheets/variables.scss -type f | entr -n sh ./docs/prepare.sh &
1001
+ find ./.cz.yaml ./config/* ./docs/.* ./docs/* ./mkdocs.yml ./README.md -not -path ./docs/assets/stylesheets/variables.scss -type f | entr -n sh ./docs/prepare.sh &
1000
1002
  echo -n "${!}" >./docs/.serve.pid
1001
1003
  sleep 2
1002
1004
  else
@@ -1026,12 +1028,12 @@ pages:
1026
1028
  changes: !reference [.pages, rules, changes]
1027
1029
  - if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED
1028
1030
  changes: !reference [.pages, rules, changes]
1031
+ allow_failure: true
1029
1032
  when: manual
1030
1033
 
1031
1034
  pdf:
1032
1035
  extends:
1033
1036
  - pages
1034
- stage: deploy
1035
1037
  artifacts:
1036
1038
  expire_in: 1 hour
1037
1039
  paths:
@@ -63,6 +63,10 @@ repos:
63
63
  - id: mixed-line-ending
64
64
  - id: trailing-whitespace
65
65
  args: ['--markdown-linebreak-ext=md']
66
+ exclude: >
67
+ (?x)(
68
+ .*.md$
69
+ )
66
70
 
67
71
  # Repository: pre-commit-hooks
68
72
  - repo: https://github.com/pre-commit/pygrep-hooks
@@ -111,7 +115,7 @@ repos:
111
115
 
112
116
  # Repository: gcil
113
117
  - repo: https://gitlab.com/RadianDevCore/tools/gcil
114
- rev: 9db7ca21
118
+ rev: 10.2.0
115
119
  hooks:
116
120
  - id: run-gcil-push
117
121
  name: Run GitLab CI job with gcil (codestyle)
@@ -1,5 +1,62 @@
1
1
  # Changelog
2
2
 
3
+ <a name="4.2.0"></a>
4
+ ## [4.2.0](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/compare/4.1.0...4.2.0) (2025-05-31)
5
+
6
+ ### ✨ Features
7
+
8
+ - **entrypoint:** avoid 'sleep' calls without user input TTY ([e3ecb29](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/e3ecb29f87fbc505d8eec491733809cc56a8a8a6))
9
+ - **pre-commit-config:** exclude '.md' files from 'trailing-whitespace' ([db98cc2](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/db98cc22984380e4f47f16b3f6cd425db98d57ad))
10
+
11
+ ### 🐛 Bug Fixes
12
+
13
+ - **pre-commit:** fix empty hooks with 'hooks: []' upon '--configure' ([3ef9cbe](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/3ef9cbe3cebcc9627bd4510a519b13ce41cdfd89))
14
+
15
+ ### ⚙️ Cleanups
16
+
17
+ - **pre-commit:** migrate to 'gcil' 10.2.0 ([257ec3a](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/257ec3ac7a0efcce32aa759c049a3977cc485537))
18
+
19
+ ### 🚀 CI
20
+
21
+ - **gitlab-ci:** remove unrequired 'stage: deploy' in 'pdf' job ([e07a8f2](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/e07a8f29b735772357cd1235d7d76a39345ec0f9))
22
+
23
+
24
+ <a name="4.1.0"></a>
25
+ ## [4.1.0](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/compare/4.0.0...4.1.0) (2025-05-31)
26
+
27
+ ### ✨ Features
28
+
29
+ - **configurations:** implement support for '.gitmodules' files ([f4f452d](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/f4f452d51ead15299a65d8b9a536a1d48e17be42))
30
+ - **configurations:** implement support for 'Dockerfile' files ([dfb036c](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/dfb036c3d97f401c9afc0b31faa5ce09a0d039a7))
31
+ - **configurations:** add support for 'scripts/' commit messages ([274516d](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/274516d3d81ffc48c0d58e70e19b546a172d19f8))
32
+
33
+ ### 🐛 Bug Fixes
34
+
35
+ - **hooks:** resolve changes detection for 'path.ext -> path.ext2' ([6a53954](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/6a53954af6a003b7ade8dfcc14ffcefcf55d382b))
36
+
37
+ ### 📚 Documentation
38
+
39
+ - **license, mkdocs:** raise copyright year to '2025' ([ba17df1](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/ba17df10a19c3d450678b5f128a27daeb3529982))
40
+ - **prepare:** avoid 'TOC' injection if 'hide: - toc' is used ([b6664ff](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/b6664ff041282057eaed12a89612e283a20c1882))
41
+
42
+ ### 🎨 Styling
43
+
44
+ - **colors:** ignore 'Colored' import 'Incompatible import' warning ([6b04f76](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/6b04f76c1800e40e303ceed028646d6f6ac4404c))
45
+
46
+ ### ⚙️ Cleanups
47
+
48
+ - **sonar-project:** configure coverage checks in SonarCloud ([e526d65](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/e526d65cc3453e0c1de5088ff799d2ef307d0acc))
49
+
50
+ ### 🚀 CI
51
+
52
+ - **commits:** disable submodules clone with 'GIT_SUBMODULE_STRATEGY' ([87e2b11](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/87e2b11a55ad0dc4d4116f70360ae6bcdf82ec32))
53
+ - **commits:** ensure './.cz.yaml' is always being used by 'git cz' ([d7038a5](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/d7038a5579261727a4dc845d15da16a7be622ead))
54
+ - **gitlab-ci:** ensure 'pages' job does not block pipeline if manual ([b4ed026](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/b4ed0267cd180eac766c18b17b2d2ab3e0f901f6))
55
+ - **gitlab-ci:** change release title to include tag version ([a9a8a53](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/a9a8a53b7a22d4be42eab3ab7c776d3c1bd19813))
56
+ - **gitlab-ci:** run coverage jobs if 'sonar-project.properties' changes ([cca4330](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/cca433013b774614af4c25302cda283b0f53c85d))
57
+ - **gitlab-ci:** watch for 'docs/.*' changes in 'pages' jobs ([582f84f](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/commit/582f84fd969448a3f5ee047fcaa70d699d4260f0))
58
+
59
+
3
60
  <a name="4.0.0"></a>
4
61
  ## [4.0.0](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/compare/3.1.0...4.0.0) (2025-01-01)
5
62
 
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2024 Adrian DC
189
+ Copyright 2024-2025 Adrian DC
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pre-commit-crocodile
3
- Version: 4.0.0
3
+ Version: 4.2.0
4
4
  Summary: Git hooks intended for developers using pre-commit
5
5
  Home-page: https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile
6
6
  Author: Adrian DC
@@ -32,6 +32,19 @@ Requires-Dist: PyYAML>=6.0
32
32
  Requires-Dist: ruamel.yaml>=0.18.6
33
33
  Requires-Dist: setuptools>=45.1.0
34
34
  Requires-Dist: update_checker>=0.18.0
35
+ Dynamic: author
36
+ Dynamic: author-email
37
+ Dynamic: classifier
38
+ Dynamic: description
39
+ Dynamic: description-content-type
40
+ Dynamic: home-page
41
+ Dynamic: keywords
42
+ Dynamic: license
43
+ Dynamic: license-file
44
+ Dynamic: project-url
45
+ Dynamic: requires-dist
46
+ Dynamic: requires-python
47
+ Dynamic: summary
35
48
 
36
49
  # pre-commit-crocodile
37
50
 
@@ -75,7 +88,7 @@ Git hooks intended for developers using [pre-commit](https://pre-commit.com/) an
75
88
 
76
89
  ## Preview
77
90
 
78
- ![preview.svg](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/raw/4.0.0/docs/preview.svg)
91
+ ![preview.svg](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/raw/4.2.0/docs/preview.svg)
79
92
 
80
93
  ---
81
94
 
@@ -40,7 +40,7 @@ Git hooks intended for developers using [pre-commit](https://pre-commit.com/) an
40
40
 
41
41
  ## Preview
42
42
 
43
- ![preview.svg](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/raw/4.0.0/docs/preview.svg)
43
+ ![preview.svg](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/raw/4.2.0/docs/preview.svg)
44
44
 
45
45
  ---
46
46
 
@@ -93,7 +93,8 @@ sed -i \
93
93
  # Inject 'toc' section (PDF only)
94
94
  find "${docs_path}/" -name '*.md' \
95
95
  | while read -r file_path; do
96
- if ! grep -q '\[TOC\]' "${file_path}" \
96
+ if ! grep -A1 '^hide:$' "${file_path}" | grep -q '^ - toc$' \
97
+ && ! grep -q '\[TOC\]' "${file_path}" \
97
98
  && ! grep -c '^## ' "${file_path}" | grep -q '^0$\|^1$' \
98
99
  && ! grep -q '^<!-- documentation no-toc -->$' "${file_path}" \
99
100
  && ! grep -q '^<!-- generated documentation section -->$' "${file_path}"; then
@@ -19,7 +19,7 @@ site_name: pre-commit-crocodile
19
19
  site_url: https://radiandevcore.gitlab.io/tools/pre-commit-crocodile
20
20
 
21
21
  # Project copyright
22
- copyright: Copyright &copy; 2024 - <a href="https://gitlab.com/AdrianDC">Adrian DC</a>
22
+ copyright: Copyright &copy; 2024-2025 - <a href="https://gitlab.com/AdrianDC">Adrian DC</a>
23
23
 
24
24
  # Excluded sources
25
25
  exclude_docs: |
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pre-commit-crocodile
3
- Version: 4.0.0
3
+ Version: 4.2.0
4
4
  Summary: Git hooks intended for developers using pre-commit
5
5
  Home-page: https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile
6
6
  Author: Adrian DC
@@ -32,6 +32,19 @@ Requires-Dist: PyYAML>=6.0
32
32
  Requires-Dist: ruamel.yaml>=0.18.6
33
33
  Requires-Dist: setuptools>=45.1.0
34
34
  Requires-Dist: update_checker>=0.18.0
35
+ Dynamic: author
36
+ Dynamic: author-email
37
+ Dynamic: classifier
38
+ Dynamic: description
39
+ Dynamic: description-content-type
40
+ Dynamic: home-page
41
+ Dynamic: keywords
42
+ Dynamic: license
43
+ Dynamic: license-file
44
+ Dynamic: project-url
45
+ Dynamic: requires-dist
46
+ Dynamic: requires-python
47
+ Dynamic: summary
35
48
 
36
49
  # pre-commit-crocodile
37
50
 
@@ -75,7 +88,7 @@ Git hooks intended for developers using [pre-commit](https://pre-commit.com/) an
75
88
 
76
89
  ## Preview
77
90
 
78
- ![preview.svg](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/raw/4.0.0/docs/preview.svg)
91
+ ![preview.svg](https://gitlab.com/RadianDevCore/tools/pre-commit-crocodile/raw/4.2.0/docs/preview.svg)
79
92
 
80
93
  ---
81
94
 
@@ -7,7 +7,7 @@ from typing import List
7
7
  # Modules libraries
8
8
  from setuptools import find_packages, setup
9
9
 
10
- # Assets
10
+ # Assets importation
11
11
  for asset in [
12
12
  '.cz.yaml',
13
13
  ]:
@@ -16,3 +16,6 @@ sonar.sources=src
16
16
 
17
17
  # Python versions
18
18
  sonar.python.version=3.9, 3.10, 3.11, 3.12
19
+
20
+ # Patterns used to exclude some files from coverage report.
21
+ sonar.coverage.exclusions=docs/**/*,setup.py
@@ -63,6 +63,10 @@ repos:
63
63
  - id: mixed-line-ending
64
64
  - id: trailing-whitespace
65
65
  args: ['--markdown-linebreak-ext=md']
66
+ exclude: >
67
+ (?x)(
68
+ .*.md$
69
+ )
66
70
 
67
71
  # Repository: pre-commit-hooks
68
72
  - repo: https://github.com/pre-commit/pygrep-hooks
@@ -118,7 +118,8 @@ class Entrypoint:
118
118
  print(' ')
119
119
  Platform.flush()
120
120
  Argcomplete.configure()
121
- sleep(2)
121
+ if Platform.IS_TTY_STDIN:
122
+ sleep(2)
122
123
 
123
124
  # Install commitizen completion
124
125
  if options.install and not Commitizen.configured():
@@ -130,7 +131,8 @@ class Entrypoint:
130
131
  Platform.flush()
131
132
  commitizen_file: str = Commitizen.configure()
132
133
  print(f'commitizen completion enabled in: {commitizen_file}')
133
- sleep(1)
134
+ if Platform.IS_TTY_STDIN:
135
+ sleep(1)
134
136
 
135
137
  # Bind specific configurations
136
138
  if options.config:
@@ -222,7 +224,8 @@ class Entrypoint:
222
224
  mode='w',
223
225
  ) as f:
224
226
  f.write(data)
225
- sleep(1)
227
+ if Platform.IS_TTY_STDIN:
228
+ sleep(1)
226
229
 
227
230
  # Configure unused hooks
228
231
  PreCommit.configure_unused_hooks(default=options.default)
@@ -337,7 +340,8 @@ class Entrypoint:
337
340
  f'{Colors.RESET}')
338
341
 
339
342
  # Delay user interactions
340
- sleep(5)
343
+ if Platform.IS_TTY_STDIN:
344
+ sleep(5)
341
345
 
342
346
  # Configure badges
343
347
  elif options.badges and configurations_files:
@@ -363,7 +367,8 @@ class Entrypoint:
363
367
  f'{Colors.RESET}')
364
368
 
365
369
  # Delay user interactions
366
- sleep(5)
370
+ if Platform.IS_TTY_STDIN:
371
+ sleep(5)
367
372
 
368
373
  # Enable hooks
369
374
  if options.enable:
@@ -3,7 +3,7 @@
3
3
  # Standard libraries
4
4
  from pathlib import Path
5
5
  from shutil import copyfile, move
6
- from typing import List
6
+ from typing import Dict, List
7
7
 
8
8
  # Components
9
9
  from ..features.git import Git
@@ -46,7 +46,7 @@ class PreCommit:
46
46
  'clean',
47
47
  ])
48
48
 
49
- # Configure unused hooks, pylint: disable=too-many-branches,too-many-statements
49
+ # Configure unused hooks, pylint: disable=too-many-branches,too-many-locals,too-many-statements
50
50
  @staticmethod
51
51
  def configure_unused_hooks(
52
52
  default: bool,
@@ -57,9 +57,14 @@ class PreCommit:
57
57
  configuration_moved: bool = False
58
58
  configuration_tmp: bool = False
59
59
  data_lines: List[str]
60
- hook_id: str
60
+ hook_id: str = '- id: '
61
61
  hook_offset: str
62
62
  hook_section: bool
63
+ hooks_element: str = 'hooks:'
64
+ hooks_empty_flag: Dict[int, bool]
65
+ hooks_ending: str
66
+ hooks_index: int
67
+ hooks_line: str
63
68
  hooks_unused: List[str] = []
64
69
 
65
70
  # Fake pre-commit configuration
@@ -118,36 +123,58 @@ class PreCommit:
118
123
 
119
124
  # Disable pre-commit unused hooks
120
125
  if hooks_unused:
126
+
127
+ # Parse pre-commit hooks
128
+ data_lines = []
129
+ hook_section = False
130
+ hooks_empty_flag = {}
131
+ hooks_index = -1
121
132
  with open(
122
133
  configuration_file,
123
134
  encoding='utf8',
124
135
  mode='r',
125
136
  ) as f:
126
- data_lines = f.readlines()
127
- with open(
128
- configuration_file,
129
- encoding='utf8',
130
- mode='w',
131
- ) as f:
132
- hook_section = False
133
- hook_id = '- id: '
134
- for line in data_lines:
137
+ for line in f.readlines():
135
138
  line_stripped = line.strip()
139
+
140
+ # Parse lines
136
141
  if not line_stripped:
137
- f.write(line)
142
+ data_lines.append(line)
138
143
  hook_section = False
144
+ elif line_stripped.startswith(hooks_element):
145
+ hooks_index = len(data_lines)
146
+ hooks_empty_flag[hooks_index] = True
147
+ data_lines.append(line)
139
148
  elif any(
140
149
  line_stripped == f'{hook_id}{hook}' for hook in hooks_unused):
141
- f.write(line.replace(hook_id, f'# {hook_id}'))
150
+ data_lines.append(line.replace(hook_id, f'# {hook_id}'))
142
151
  hook_offset = line[0:line.find(hook_id)]
143
152
  hook_section = True
144
153
  elif line_stripped.startswith(hook_id):
145
- f.write(line)
154
+ data_lines.append(line)
155
+ if hooks_index != -1:
156
+ hooks_empty_flag[hooks_index] = False
146
157
  hook_section = False
147
158
  elif hook_section:
148
- f.write(f'{hook_offset}# {line.lstrip()}')
159
+ data_lines.append(f'{hook_offset}# {line.lstrip()}')
149
160
  else:
150
- f.write(line)
161
+ data_lines.append(line)
162
+ hooks_index = -1
163
+
164
+ # Fix empty hooks
165
+ for index, empty in hooks_empty_flag.items():
166
+ if empty:
167
+ hooks_line = data_lines[index]
168
+ hooks_ending = hooks_line[len(hooks_line.rstrip('\r\n')):]
169
+ data_lines[index] = hooks_line.rstrip('\r\n') + ' []' + hooks_ending
170
+
171
+ # Write pre-commit hooks
172
+ with open(
173
+ configuration_file,
174
+ encoding='utf8',
175
+ mode='w',
176
+ ) as f:
177
+ f.writelines(data_lines)
151
178
 
152
179
  # Result
153
180
  return True
@@ -28,7 +28,7 @@ class ChangesMatcher(NamedTuple):
28
28
  types: List[ChangesType]
29
29
 
30
30
  # Commits changes constants
31
- COMMITS_CHANGES_PATTERN: str = r'^#\s*(new file|modified|deleted|renamed|copied):\s*(.+)$'
31
+ COMMITS_CHANGES_PATTERN: str = r'^#\s*(new file|modified|deleted|renamed|copied):\s*(.* -> |)(.+)$'
32
32
  COMMITS_CHANGES_SECTION: str = '# Changes to be committed:'
33
33
 
34
34
  # Commits comments constants
@@ -202,6 +202,17 @@ CHANGES_MATCHERS: List[ChangesMatcher] = [
202
202
  ),
203
203
  ],
204
204
  ),
205
+ ChangesMatcher(
206
+ commit_scope='submodules',
207
+ types=[
208
+ ChangesType(
209
+ commit_type='chore',
210
+ changes=[
211
+ r'\.gitmodules$',
212
+ ],
213
+ ),
214
+ ],
215
+ ),
205
216
  ChangesMatcher(
206
217
  commit_scope='makefile',
207
218
  types=[
@@ -214,6 +225,17 @@ CHANGES_MATCHERS: List[ChangesMatcher] = [
214
225
  ),
215
226
  ],
216
227
  ),
228
+ ChangesMatcher(
229
+ commit_scope='dockerfile',
230
+ types=[
231
+ ChangesType(
232
+ commit_type='build',
233
+ changes=[
234
+ r'Dockerfile$',
235
+ ],
236
+ ),
237
+ ],
238
+ ),
217
239
  ChangesMatcher(
218
240
  commit_scope='commitizen',
219
241
  types=[
@@ -281,6 +303,17 @@ CHANGES_MATCHERS: List[ChangesMatcher] = [
281
303
  ),
282
304
  ],
283
305
  ),
306
+ ChangesMatcher(
307
+ commit_scope='scripts',
308
+ types=[
309
+ ChangesType(
310
+ commit_type='chore',
311
+ changes=[
312
+ r'scripts/',
313
+ ],
314
+ ),
315
+ ],
316
+ ),
284
317
  ChangesMatcher(
285
318
  commit_scope='setup',
286
319
  types=[
@@ -101,7 +101,7 @@ def parse_commit_input(filepath: str) -> Tuple[bool, bool, str, List[str]]:
101
101
  if capture:
102
102
  matches = match(COMMITS_CHANGES_PATTERN, content)
103
103
  if matches:
104
- changes.append(matches.group(2).strip())
104
+ changes.append(matches.group(3).strip())
105
105
  elif not content.strip() or content.startswith('#'):
106
106
  capture = False
107
107
 
@@ -8,7 +8,7 @@ try:
8
8
  try: # colored>=2.0.0
9
9
  from colored import Colored
10
10
  except ImportError: # colored<2.0.0 # pragma: no cover
11
- from colored import colored as Colored
11
+ from colored import colored as Colored # type: ignore[assignment]
12
12
  except ModuleNotFoundError: # pragma: no cover
13
13
  pass
14
14
 
@@ -15,9 +15,11 @@ $[[ inputs.name ]]:
15
15
  image: $[[ inputs.image ]]
16
16
  stage: $[[ inputs.stage ]]
17
17
  needs: []
18
+ variables:
19
+ GIT_SUBMODULE_STRATEGY: none
18
20
  before_script:
19
21
  # Check system context
20
- - git cz version -r
22
+ - git cz --config ./.cz.yaml version -r
21
23
  # Show commits documentation
22
24
  - |
23
25
  (
@@ -29,7 +31,7 @@ $[[ inputs.name ]]:
29
31
  echo '---'
30
32
  echo "git cz ${command}:"
31
33
  echo -e "\033[1;${color}m"
32
- git cz "${command}" | sed 's#^$# #g'
34
+ git cz --config ./.cz.yaml "${command}" | sed 's#^$# #g'
33
35
  echo -e '\033[0m '
34
36
  done
35
37
  echo '---'
@@ -73,7 +75,7 @@ $[[ inputs.name ]]:
73
75
  git log --pretty=oneline --abbrev-commit "${range_sha}" | sed "s#^\([^ ]*\) #$(printf '\033[1;33m')\1$(printf '\033[0m') #g"
74
76
  echo ' '
75
77
  set -x
76
- git cz --no-raise 3 check --rev-range "${range_sha}"
78
+ git cz --config ./.cz.yaml --no-raise 3 check --rev-range "${range_sha}"
77
79
  # Validate pre-commit checks
78
80
  - |
79
81
  set +x