pre-commit-vauxoo 8.3.24__tar.gz → 8.3.26__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 (121) hide show
  1. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/.bumpversion.cfg +1 -1
  2. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/.github/workflows/github-actions.yml +9 -2
  3. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/ChangeLog +14 -0
  4. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/PKG-INFO +16 -1
  5. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/README.rst +2 -2
  6. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/docs/conf.py +1 -1
  7. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/requirements.txt +1 -0
  8. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/setup.py +1 -1
  9. pre_commit_vauxoo-8.3.26/src/pre_commit_vauxoo/__init__.py +1 -0
  10. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}no_ruff{% endif %}/.pre-commit-config-optional.yaml.jinja +9 -9
  11. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}ruff{% endif %}/.pre-commit-config.yaml.jinja +7 -7
  12. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/pre_commit_vauxoo.py +47 -14
  13. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo.egg-info/PKG-INFO +16 -1
  14. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo.egg-info/requires.txt +1 -0
  15. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/tests/test_pre_commit_vauxoo.py +52 -0
  16. pre_commit_vauxoo-8.3.24/src/pre_commit_vauxoo/__init__.py +0 -1
  17. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/.appveyor.yml +0 -0
  18. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/.cookiecutterrc +0 -0
  19. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/.coveragerc +0 -0
  20. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/.readthedocs.yml +0 -0
  21. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/.travis.yml +0 -0
  22. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/AUTHORS.rst +0 -0
  23. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/CONTRIBUTING.rst +0 -0
  24. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/LICENSE +0 -0
  25. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/MANIFEST.in +0 -0
  26. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/ci/bootstrap.py +0 -0
  27. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/ci/requirements.txt +0 -0
  28. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/ci/templates/.appveyor.yml +0 -0
  29. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/ci/templates/.github/workflows/github-actions.yml +0 -0
  30. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/ci/templates/.travis.yml +0 -0
  31. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/ci/templates/tox.ini +0 -0
  32. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/docs/authors.rst +0 -0
  33. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/docs/changelog.rst +0 -0
  34. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/docs/contributing.rst +0 -0
  35. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/docs/index.rst +0 -0
  36. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/docs/readme.rst +0 -0
  37. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/docs/requirements.txt +0 -0
  38. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/docs/spelling_wordlist.txt +0 -0
  39. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/pytest.ini +0 -0
  40. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_autofix1/README.rst +0 -0
  41. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_autofix1/__init__.py +0 -0
  42. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_autofix1/__manifest__.py +0 -0
  43. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_autofix1/demo/demo.xml +0 -0
  44. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_autofix1/models/__init__.py +0 -0
  45. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_autofix1/models/models.py +0 -0
  46. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_autofix1/security/ir.model.access.csv +0 -0
  47. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_autofix1/views/views.xml +0 -0
  48. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/README.rst +0 -0
  49. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/__init__.py +0 -0
  50. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/__manifest__.py +0 -0
  51. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/deactivate.jinja +0 -0
  52. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/demo/demo.xml +0 -0
  53. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/models/__init__.py +0 -0
  54. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/models/markupsafe_sanitized.py +0 -0
  55. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/models/models.py +0 -0
  56. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/security/ir.model.access.csv +0 -0
  57. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/static/src/js/example.js +0 -0
  58. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_example1/views/views.xml +0 -0
  59. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_uninstallable/__init__.py +0 -0
  60. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_uninstallable/__manifest__.py +0 -0
  61. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_uninstallable/models/__init__.py +0 -0
  62. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_uninstallable/models/non_install.py +0 -0
  63. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_warnings1/README.rst +0 -0
  64. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_warnings1/__init__.py +0 -0
  65. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_warnings1/__manifest__.py +0 -0
  66. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_warnings1/demo/demo.xml +0 -0
  67. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_warnings1/models/__init__.py +0 -0
  68. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_warnings1/models/models.py +0 -0
  69. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_warnings1/security/ir.model.access.csv +0 -0
  70. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_warnings1/tests/data/ruff_optional_use_cases.py +0 -0
  71. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/resources/module_warnings1/views/views.xml +0 -0
  72. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/setup.cfg +0 -0
  73. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/__main__.py +0 -0
  74. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/.bandit-optional.yml +0 -0
  75. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/.editorconfig +0 -0
  76. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/.eslintrc.config.mjs +0 -0
  77. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/.isort.cfg +0 -0
  78. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/.markdownlint-autofix.yaml.jinja +0 -0
  79. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/.oca_hooks.cfg.jinja +0 -0
  80. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/.prettierrc.config.cjs.jinja +0 -0
  81. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/doc8.ini +0 -0
  82. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/pyproject.toml.jinja +0 -0
  83. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}no_ruff{% endif %}/.bandit-experimental.yml.jinja +0 -0
  84. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}no_ruff{% endif %}/.flake8-optional.jinja +0 -0
  85. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}no_ruff{% endif %}/.flake8.jinja +0 -0
  86. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}no_ruff{% endif %}/.oca_hooks-autofix.cfg.jinja +0 -0
  87. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}no_ruff{% endif %}/.pre-commit-config-autofix.yaml.jinja +0 -0
  88. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}no_ruff{% endif %}/.pre-commit-config.yaml.jinja +0 -0
  89. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}no_ruff{% endif %}/.pylintrc-experimental.jinja +0 -0
  90. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}no_ruff{% endif %}/.pylintrc-optional.jinja +0 -0
  91. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}no_ruff{% endif %}/.pylintrc.jinja +0 -0
  92. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}ruff{% endif %}/.bandit-experimental.yml.jinja +0 -0
  93. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}ruff{% endif %}/.flake8.jinja +0 -0
  94. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}ruff{% endif %}/.oca_hooks-autofix.cfg.jinja +0 -0
  95. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}ruff{% endif %}/.pre-commit-config-autofix.yaml.jinja +0 -0
  96. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}ruff{% endif %}/.pre-commit-config-optional.yaml.jinja +0 -0
  97. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}ruff{% endif %}/.pylintrc.jinja +0 -0
  98. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}ruff{% endif %}/.ruff-autofix.toml.jinja +0 -0
  99. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}ruff{% endif %}/.ruff-experimental.toml.jinja +0 -0
  100. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}ruff{% endif %}/.ruff.toml.jinja +0 -0
  101. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/cli.py +0 -0
  102. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/git_hook_pre_commit +0 -0
  103. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/hooks/__init__.py +0 -0
  104. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/hooks/check_commit_msg.py +0 -0
  105. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/hooks/check_deactivate_jinja.py +0 -0
  106. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/logging_colored.py +0 -0
  107. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo/version_check.py +0 -0
  108. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo.egg-info/SOURCES.txt +0 -0
  109. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo.egg-info/dependency_links.txt +0 -0
  110. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo.egg-info/entry_points.txt +0 -0
  111. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo.egg-info/not-zip-safe +0 -0
  112. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/src/pre_commit_vauxoo.egg-info/top_level.txt +0 -0
  113. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/tests/data_ruff/ruff_mandatory_use_cases.txt +0 -0
  114. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/tests/data_ruff/ruff_migrations_security_use_cases.txt +0 -0
  115. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/tests/data_ruff/ruff_odoo_method_use_cases.txt +0 -0
  116. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/tests/data_ruff/ruff_optional_bandit_use_cases.txt +0 -0
  117. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/tests/diffs/module_autofix1_expected_10.diff +0 -0
  118. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/tests/diffs/module_autofix1_expected_20.diff +0 -0
  119. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/tests/diffs/module_autofix1_expected_30.diff +0 -0
  120. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/tox.ini +0 -0
  121. {pre_commit_vauxoo-8.3.24 → pre_commit_vauxoo-8.3.26}/variables.sh +0 -0
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 8.3.24
2
+ current_version = 8.3.26
3
3
  commit = True
4
4
  tag = True
5
5
  sign_tags = True
@@ -10,6 +10,10 @@ on:
10
10
  pull_request:
11
11
  branches:
12
12
  - main
13
+ # Used by the "release" workflow to publish the tag it just pushed. A tag pushed
14
+ # with the GITHUB_TOKEN does not emit the push event that would start this
15
+ # workflow, but "workflow_dispatch" is the documented exception to that rule
16
+ workflow_dispatch:
13
17
 
14
18
  env:
15
19
  CACHE_VERSION: 1
@@ -132,9 +136,12 @@ jobs:
132
136
  TOXPYTHON: '${{ matrix.toxpython }}'
133
137
  run: |
134
138
  tox -e ${{ matrix.tox_env }} -v
135
- # TODO: Publish package only for signed tags
139
+ # Publishes both the tags pushed from a checkout, e.g. "bump2version" run in a
140
+ # laptop, and the ones dispatched by the "release" workflow. The latter are not
141
+ # GPG signed since no key is available in the runner.
142
+ # Only the ref is checked, not the event, so the dispatched runs publish too
136
143
  - name: Publish package
137
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && contains(matrix.tox_env, 'build')
144
+ if: startsWith(github.ref, 'refs/tags') && contains(matrix.tox_env, 'build')
138
145
  run: |
139
146
  ls -lah dist/*
140
147
  python -m twine upload --verbose -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} --repository-url https://upload.pypi.org/legacy/ dist/*
@@ -1,6 +1,20 @@
1
1
  CHANGES
2
2
  =======
3
3
 
4
+ v8.3.26
5
+ -------
6
+
7
+ * Bump version: 8.3.25 → 8.3.26
8
+ * [ADD] release: Cut a release from a button without a laptop (#315)
9
+ * [FIX] pre\_commit\_vauxoo: skip the commit range check in the CI clone of a dev fork (#313)
10
+ * [FIX] pre\_commit\_vauxoo: install and run the git hook from a linked worktree (#314)
11
+
12
+ v8.3.25
13
+ -------
14
+
15
+ * Bump version: 8.3.24 → 8.3.25
16
+ * [FIX] cfg: vx-check-commit-log raises error if ruff is enabled (#312)
17
+
4
18
  v8.3.24
5
19
  -------
6
20
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pre-commit-vauxoo
3
- Version: 8.3.24
3
+ Version: 8.3.26
4
4
  Summary: pre-commit script to run automatically the configuration and variables custom from Vauxoo
5
5
  Home-page: https://github.com/Vauxoo/pre-commit-vauxoo
6
6
  Author: Vauxoo
@@ -33,6 +33,7 @@ Requires-Dist: jinja2
33
33
  Requires-Dist: packaging
34
34
  Requires-Dist: pathspec<1.0.0
35
35
  Requires-Dist: pgsanity
36
+ Requires-Dist: plumbum
36
37
  Requires-Dist: pre-commit
37
38
  Requires-Dist: pyyaml
38
39
  Dynamic: author
@@ -439,6 +440,20 @@ without touching the package's own ``.bumpversion.cfg``.
439
440
  CHANGES
440
441
  =======
441
442
 
443
+ v8.3.26
444
+ -------
445
+
446
+ * Bump version: 8.3.25 → 8.3.26
447
+ * [ADD] release: Cut a release from a button without a laptop (#315)
448
+ * [FIX] pre\_commit\_vauxoo: skip the commit range check in the CI clone of a dev fork (#313)
449
+ * [FIX] pre\_commit\_vauxoo: install and run the git hook from a linked worktree (#314)
450
+
451
+ v8.3.25
452
+ -------
453
+
454
+ * Bump version: 8.3.24 → 8.3.25
455
+ * [FIX] cfg: vx-check-commit-log raises error if ruff is enabled (#312)
456
+
442
457
  v8.3.24
443
458
  -------
444
459
 
@@ -50,9 +50,9 @@ Overview
50
50
  :alt: Supported versions
51
51
  :target: https://pypi.org/project/pre-commit-vauxoo
52
52
 
53
- .. |commits-since| image:: https://img.shields.io/github/commits-since/Vauxoo/pre-commit-vauxoo/v8.3.24.svg
53
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/Vauxoo/pre-commit-vauxoo/v8.3.26.svg
54
54
  :alt: Commits since latest release
55
- :target: https://github.com/Vauxoo/pre-commit-vauxoo/compare/v8.3.24...main
55
+ :target: https://github.com/Vauxoo/pre-commit-vauxoo/compare/v8.3.26...main
56
56
 
57
57
 
58
58
 
@@ -18,7 +18,7 @@ project = "pre-commit-vauxoo"
18
18
  year = "2022"
19
19
  author = "Vauxoo"
20
20
  copyright = f"{year}, {author}"
21
- version = release = "8.3.24"
21
+ version = release = "8.3.26"
22
22
 
23
23
  pygments_style = "trac"
24
24
  templates_path = ["."]
@@ -4,5 +4,6 @@ jinja2
4
4
  packaging
5
5
  pathspec<1.0.0 # To avoid the deprecation warning from gitwildmatch in pre-commit
6
6
  pgsanity
7
+ plumbum # copier runs git through it, its environment is the one to clean up (see copy_cfg_files)
7
8
  pre-commit
8
9
  pyyaml # To read the hooks of the autofix configuration file (--autofixes-commit-by-module)
@@ -37,7 +37,7 @@ def read(*names, **kwargs):
37
37
 
38
38
  setup(
39
39
  name="pre-commit-vauxoo",
40
- version="8.3.24",
40
+ version="8.3.26",
41
41
  license="LGPL-3.0-or-later",
42
42
  description="pre-commit script to run automatically the configuration and variables custom from Vauxoo",
43
43
  long_description_content_type="text/x-rst",
@@ -0,0 +1 @@
1
+ __version__ = "8.3.26"
@@ -62,15 +62,15 @@ repos:
62
62
  name: RST lint
63
63
  args:
64
64
  - --config=.config/doc8.ini
65
- - repo: local
66
- hooks:
67
- - id: vx-check-commit-log
68
- name: commit message range check
69
- description: Validate commit messages from VERSION..HEAD using the Odoo/Vauxoo structure.
70
- entry: vx-check-commit-log
71
- language: python
72
- pass_filenames: false
73
- always_run: true
65
+ # - repo: local
66
+ # hooks:
67
+ # - id: vx-check-commit-log
68
+ # name: commit message range check
69
+ # description: Validate commit messages from VERSION..HEAD using the Odoo/Vauxoo structure.
70
+ # entry: vx-check-commit-log
71
+ # language: python
72
+ # pass_filenames: false
73
+ # always_run: true
74
74
  - repo: https://github.com/PyCQA/flake8
75
75
  {%- if flake8_matrix_value >= 20 %}
76
76
  rev: 7.3.0
@@ -109,13 +109,13 @@ repos:
109
109
  language: python
110
110
  types: [text]
111
111
  files: (^deactivate\.jinja$|/data/neutralize\.sql$)
112
- - id: vx-check-commit-log
113
- name: commit message range check
114
- description: Validate commit messages from VERSION..HEAD using the Odoo/Vauxoo structure.
115
- entry: vx-check-commit-log
116
- language: python
117
- pass_filenames: false
118
- always_run: true
112
+ # - id: vx-check-commit-log
113
+ # name: commit message range check
114
+ # description: Validate commit messages from VERSION..HEAD using the Odoo/Vauxoo structure.
115
+ # entry: vx-check-commit-log
116
+ # language: python
117
+ # pass_filenames: false
118
+ # always_run: true
119
119
  - repo: https://github.com/pre-commit/pre-commit-hooks
120
120
  {%- if pre_commit_matrix_value >= 20 %}
121
121
  rev: v6.0.0
@@ -13,6 +13,7 @@ import sys
13
13
 
14
14
  import copier
15
15
  import yaml
16
+ from plumbum import local
16
17
 
17
18
  from . import __version__, logging_colored, version_check
18
19
 
@@ -34,6 +35,10 @@ re_pylint_check_ruff_codes = re.compile(
34
35
 
35
36
  CFG_SUBFOLDER = ".config"
36
37
 
38
+ # The variables that point git to a repository other than the one of the working
39
+ # directory. git exports them to the hooks of a linked worktree with absolute paths
40
+ GIT_REPOSITORY_ENVVARS = ("GIT_DIR", "GIT_WORK_TREE", "GIT_INDEX_FILE", "GIT_COMMON_DIR")
41
+
37
42
  # Scope of files to run the hooks on (--all, --last-commit and --diff)
38
43
  # The templates that depend on ruff live in a folder whose name is the condition
39
44
  # itself, so copier renders the matching one and skips the other subtree entirely.
@@ -159,6 +164,22 @@ def get_repo():
159
164
  return repo_root
160
165
 
161
166
 
167
+ def get_git_hooks_dir(repo_dirname):
168
+ """The directory git runs the hooks from, as an absolute path
169
+
170
+ It is not always "<repo>/.git/hooks": in a linked worktree ".git" is a file and the
171
+ hooks are the ones of the main repository, and "core.hooksPath" can move them anywhere.
172
+ git answers relative to the directory it runs in, or absolute when it is elsewhere
173
+ """
174
+ hooks_dir = (
175
+ subprocess
176
+ .check_output(["git", "rev-parse", "--git-path", "hooks"], cwd=repo_dirname)
177
+ .decode(sys.stdout.encoding)
178
+ .strip()
179
+ )
180
+ return full_norm_path(os.path.join(repo_dirname, hooks_dir))
181
+
182
+
162
183
  def get_files(path):
163
184
  """Tracked files of the given path, sorted and without duplicates
164
185
 
@@ -313,10 +334,13 @@ def infer_stable_ref(version, cwd=None):
313
334
  print(f"Counting commits from the local branch {version}")
314
335
  return version
315
336
 
316
- # Only when every remote is a dev fork is there nothing left to infer from. A
317
- # checkout holding a single remote that simply lacks the branch -- which is what
318
- # CI clones look like -- keeps skipping quietly, the way it always did
319
- if remotes and len(skipped) == len(remotes):
337
+ # Only when every remote is a dev fork, and one of them holds a copy of stable,
338
+ # is there a stale answer worth asking about. A checkout whose remotes simply lack
339
+ # the branch -- which is what CI clones look like, the fork's own pipeline included,
340
+ # since its only remote is the fork and it fetches only the branch being built --
341
+ # keeps skipping quietly, the way it always did
342
+ stale_copies = [name for name in skipped if git_ref_exists(f"refs/remotes/{name}/{version}", cwd=cwd)]
343
+ if remotes and len(skipped) == len(remotes) and stale_copies:
320
344
  answer = ask_for_stable_ref(version, cwd=cwd)
321
345
  if not git_rev_exists(answer, cwd=cwd):
322
346
  raise UserWarning(f"The base revision {answer} does not exist")
@@ -602,15 +626,23 @@ def copy_cfg_files( # ruff: ignore[complex-structure]
602
626
  "use_ruff": use_ruff,
603
627
  }
604
628
 
605
- copier.run_copy(
606
- src_path=precommit_config_dir,
607
- dst_path=cfg_dir,
608
- data=data,
609
- unsafe=True,
610
- defaults=True,
611
- overwrite=not no_overwrite,
612
- quiet=True,
613
- )
629
+ # copier asks git whether the template folder is a repository. Run as a hook of a
630
+ # linked worktree, git exports an absolute "GIT_DIR" that makes it answer yes for any
631
+ # folder, and copier then fails running "git ls-remote" on it. plumbum, the one that
632
+ # runs git for copier, copied the environment when it was imported, so it is the
633
+ # environment to clean up, not os.environ
634
+ with local.env():
635
+ for git_envvar in GIT_REPOSITORY_ENVVARS:
636
+ local.env.pop(git_envvar, None)
637
+ copier.run_copy(
638
+ src_path=precommit_config_dir,
639
+ dst_path=cfg_dir,
640
+ data=data,
641
+ unsafe=True,
642
+ defaults=True,
643
+ overwrite=not no_overwrite,
644
+ quiet=True,
645
+ )
614
646
 
615
647
  # copier renders the folder whose condition matched as a subfolder of the
616
648
  # destination, so its files have to be moved up to where every tool expects them.
@@ -715,6 +747,7 @@ def install_git_hook(src_path, dest_path, replacements):
715
747
  hook_content = pathlib.Path(src_path).read_text(encoding="utf-8")
716
748
  for placeholder, value in replacements.items():
717
749
  hook_content = hook_content.replace(placeholder, value)
750
+ pathlib.Path(dest_path).parent.mkdir(parents=True, exist_ok=True)
718
751
  pathlib.Path(dest_path).write_text(hook_content, encoding="utf-8")
719
752
  pathlib.Path(dest_path).chmod(pathlib.Path(dest_path).stat().st_mode | stat.S_IXUSR)
720
753
 
@@ -1001,7 +1034,7 @@ def main( # ruff: ignore[complex-structure]
1001
1034
 
1002
1035
  if install:
1003
1036
  git_hook_pre_commit_src = os.path.join(root_dir, "git_hook_pre_commit")
1004
- git_hook_pre_commit_dest = os.path.join(repo_dirname, ".git", "hooks", "pre-commit")
1037
+ git_hook_pre_commit_dest = os.path.join(get_git_hooks_dir(repo_dirname), "pre-commit")
1005
1038
  pre_commit_vauxoo_bin = resolve_console_script("pre-commit-vauxoo")
1006
1039
  _logger.info("pre-commit installed at %s", git_hook_pre_commit_dest)
1007
1040
  install_git_hook(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pre-commit-vauxoo
3
- Version: 8.3.24
3
+ Version: 8.3.26
4
4
  Summary: pre-commit script to run automatically the configuration and variables custom from Vauxoo
5
5
  Home-page: https://github.com/Vauxoo/pre-commit-vauxoo
6
6
  Author: Vauxoo
@@ -33,6 +33,7 @@ Requires-Dist: jinja2
33
33
  Requires-Dist: packaging
34
34
  Requires-Dist: pathspec<1.0.0
35
35
  Requires-Dist: pgsanity
36
+ Requires-Dist: plumbum
36
37
  Requires-Dist: pre-commit
37
38
  Requires-Dist: pyyaml
38
39
  Dynamic: author
@@ -439,6 +440,20 @@ without touching the package's own ``.bumpversion.cfg``.
439
440
  CHANGES
440
441
  =======
441
442
 
443
+ v8.3.26
444
+ -------
445
+
446
+ * Bump version: 8.3.25 → 8.3.26
447
+ * [ADD] release: Cut a release from a button without a laptop (#315)
448
+ * [FIX] pre\_commit\_vauxoo: skip the commit range check in the CI clone of a dev fork (#313)
449
+ * [FIX] pre\_commit\_vauxoo: install and run the git hook from a linked worktree (#314)
450
+
451
+ v8.3.25
452
+ -------
453
+
454
+ * Bump version: 8.3.24 → 8.3.25
455
+ * [FIX] cfg: vx-check-commit-log raises error if ruff is enabled (#312)
456
+
442
457
  v8.3.24
443
458
  -------
444
459
 
@@ -4,5 +4,6 @@ jinja2
4
4
  packaging
5
5
  pathspec<1.0.0
6
6
  pgsanity
7
+ plumbum
7
8
  pre-commit
8
9
  pyyaml
@@ -22,6 +22,7 @@ from distutils.dir_util import copy_tree # pylint:disable=deprecated-module
22
22
  import pytest
23
23
  from click.testing import CliRunner
24
24
  from jinja2 import Environment, FileSystemLoader
25
+ from plumbum import local
25
26
  from pylint.config.config_initialization import _config_initialization
26
27
  from pylint.lint import PyLinter, Run
27
28
  from yaml import Loader, load
@@ -373,6 +374,45 @@ class TestPreCommitVauxoo:
373
374
  ])
374
375
  assert not exit_code, "Exited with error_code %s" % exit_code
375
376
 
377
+ def add_worktree(self, tmp_path):
378
+ self.commit("[ADD] module_example1: initial")
379
+ worktree_dir = os.path.realpath(tmp_path / "worktree")
380
+ subprocess.check_call(["git", "worktree", "add", "-q", worktree_dir, "-b", "worktree-branch"])
381
+ return worktree_dir
382
+
383
+ def test_install_git_hook_pre_commit_worktree(self, tmp_path):
384
+ worktree_dir = self.add_worktree(tmp_path)
385
+ with self.chdir(worktree_dir):
386
+ assert Path(".git").is_file(), "The '.git' of a linked worktree is expected to be a file"
387
+ result = self.runner.invoke(main, ["--install"])
388
+ assert not result.exit_code, "Exited with error %s - %s" % (result, result.output)
389
+ # The worktrees run the hooks of the main repository
390
+ git_hook_pre_commit = os.path.join(self.tmp_dir, ".git", "hooks", "pre-commit")
391
+ assert Path(git_hook_pre_commit).is_file(), "The hook was not installed in the hooks of the main repository"
392
+
393
+ def test_install_git_hook_pre_commit_hooks_path(self):
394
+ subprocess.check_call(["git", "config", "core.hooksPath", "custom/hooks"])
395
+ os.chdir("module_example1")
396
+ result = self.runner.invoke(main, ["--install"])
397
+ assert not result.exit_code, "Exited with error %s - %s" % (result, result.output)
398
+ git_hook_pre_commit = os.path.join(self.tmp_dir, "custom", "hooks", "pre-commit")
399
+ assert Path(git_hook_pre_commit).is_file(), "The hook was not installed in core.hooksPath"
400
+ assert not Path(self.tmp_dir, ".git", "hooks", "pre-commit").exists(), "core.hooksPath was ignored"
401
+
402
+ def test_copy_cfg_files_absolute_git_dir(self, tmp_path, monkeypatch):
403
+ """git runs the hooks of a linked worktree with an absolute GIT_DIR, which made
404
+ copier take the folder of the configuration templates for a repository"""
405
+ worktree_dir = self.add_worktree(tmp_path)
406
+ with self.chdir(worktree_dir):
407
+ git_dir = subprocess.check_output(["git", "rev-parse", "--absolute-git-dir"], text=True).strip()
408
+ monkeypatch.setenv("GIT_DIR", git_dir)
409
+ # copier runs git with the environment plumbum copied when it was imported
410
+ with local.env(GIT_DIR=git_dir):
411
+ result = self.runner.invoke(main, ["--only-cp-cfg"])
412
+ assert local.env["GIT_DIR"] == git_dir, "The environment of the caller was not restored"
413
+ assert not result.exit_code, "Exited with error %s - %s" % (result, result.output)
414
+ assert Path(worktree_dir, ".config", ".pre-commit-config.yaml").is_file(), "Configuration files not copied"
415
+
376
416
  def test_commit_msg_valid_single_module(self):
377
417
  commit_msg_path = os.path.join(self.tmp_dir, ".git", "COMMIT_EDITMSG")
378
418
  Path(commit_msg_path).write_text("[FIX] module_example1: correct typo\n\nBody\n", encoding="utf-8")
@@ -603,6 +643,18 @@ class TestPreCommitVauxoo:
603
643
  with pytest.raises(UserWarning, match="--last-commits=REMOTE/BRANCH"):
604
644
  resolve_commit_message_base_ref("18.0", scope=SCOPE_LAST_COMMITS)
605
645
 
646
+ def test_ci_clone_of_a_dev_fork_skips_quietly(self, capsys):
647
+ """The pipeline of a fork: its only remote is the fork, holding only the branch built
648
+
649
+ Locally a stable remote is always there, so this only ever failed in CI.
650
+ """
651
+ self.commit("[FIX] module_example1: initial baseline")
652
+ self.add_remote("origin", "https://git.example.com/vauxoo-dev/project.git", version="18.0-feature-dev")
653
+
654
+ assert not resolve_commit_message_base_ref("18.0", scope=SCOPE_LAST_COMMITS)
655
+ assert "stable ref 18.0 was not found" in capsys.readouterr().out
656
+ assert check_commit_messages_since_version(repo_root=self.tmp_dir, version="18.0") is True
657
+
606
658
  def test_resolve_commit_message_base_ref_last_commit_scope(self):
607
659
  self.commit("[FIX] module_example1: initial baseline")
608
660
  self.commit("[FIX] module_example1: second one")
@@ -1 +0,0 @@
1
- __version__ = "8.3.24"