pre-commit-vauxoo 8.3.0__tar.gz → 8.3.2__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 (113) hide show
  1. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/.bumpversion.cfg +1 -1
  2. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/.coveragerc +3 -0
  3. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/ChangeLog +14 -0
  4. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/PKG-INFO +22 -4
  5. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/README.rst +9 -5
  6. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/docs/conf.py +1 -1
  7. pre_commit_vauxoo-8.3.2/resources/module_example1/models/__init__.py +2 -0
  8. pre_commit_vauxoo-8.3.2/resources/module_example1/models/markupsafe_sanitized.py +12 -0
  9. pre_commit_vauxoo-8.3.2/resources/module_warnings1/tests/data/ruff_optional_use_cases.py +108 -0
  10. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/setup.py +1 -1
  11. pre_commit_vauxoo-8.3.2/src/pre_commit_vauxoo/__init__.py +1 -0
  12. pre_commit_vauxoo-8.3.0/src/pre_commit_vauxoo/cfg/.bandit-experimental → pre_commit_vauxoo-8.3.2/src/pre_commit_vauxoo/cfg/.bandit-experimental.yml +18 -7
  13. pre_commit_vauxoo-8.3.2/src/pre_commit_vauxoo/cfg/.bandit-optional.yml +15 -0
  14. pre_commit_vauxoo-8.3.0/src/pre_commit_vauxoo/cfg/.flake8-optional → pre_commit_vauxoo-8.3.2/src/pre_commit_vauxoo/cfg/.flake8-optional.jinja +15 -0
  15. pre_commit_vauxoo-8.3.0/src/pre_commit_vauxoo/cfg/.flake8 → pre_commit_vauxoo-8.3.2/src/pre_commit_vauxoo/cfg/.flake8.jinja +10 -1
  16. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.pre-commit-config-optional.yaml.jinja +27 -6
  17. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.pre-commit-config.yaml.jinja +13 -3
  18. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.pylintrc-optional.jinja +15 -11
  19. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.pylintrc.jinja +172 -0
  20. pre_commit_vauxoo-8.3.2/src/pre_commit_vauxoo/cfg/{% if use_ruff %}.ruff-optional.toml{% endif %}.jinja +89 -0
  21. pre_commit_vauxoo-8.3.2/src/pre_commit_vauxoo/cfg/{% if use_ruff %}.ruff.toml{% endif %}.jinja +195 -0
  22. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cli.py +3 -2
  23. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/pre_commit_vauxoo.py +1 -1
  24. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo.egg-info/PKG-INFO +22 -4
  25. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo.egg-info/SOURCES.txt +9 -4
  26. pre_commit_vauxoo-8.3.2/tests/data_ruff/ruff_mandatory_use_cases.txt +105 -0
  27. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/tests/test_pre_commit_vauxoo.py +103 -1
  28. pre_commit_vauxoo-8.3.0/resources/module_warnings1/models/__init__.py +0 -1
  29. pre_commit_vauxoo-8.3.0/src/pre_commit_vauxoo/__init__.py +0 -1
  30. pre_commit_vauxoo-8.3.0/src/pre_commit_vauxoo/cfg/.bandit-optional +0 -8
  31. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/.appveyor.yml +0 -0
  32. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/.cookiecutterrc +0 -0
  33. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/.github/workflows/github-actions.yml +0 -0
  34. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/.readthedocs.yml +0 -0
  35. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/.travis.yml +0 -0
  36. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/AUTHORS.rst +0 -0
  37. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/CONTRIBUTING.rst +0 -0
  38. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/LICENSE +0 -0
  39. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/MANIFEST.in +0 -0
  40. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/ci/bootstrap.py +0 -0
  41. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/ci/requirements.txt +0 -0
  42. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/ci/templates/.appveyor.yml +0 -0
  43. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/ci/templates/.github/workflows/github-actions.yml +0 -0
  44. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/ci/templates/.travis.yml +0 -0
  45. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/ci/templates/tox.ini +0 -0
  46. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/docs/authors.rst +0 -0
  47. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/docs/changelog.rst +0 -0
  48. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/docs/contributing.rst +0 -0
  49. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/docs/index.rst +0 -0
  50. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/docs/readme.rst +0 -0
  51. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/docs/requirements.txt +0 -0
  52. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/docs/spelling_wordlist.txt +0 -0
  53. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/pytest.ini +0 -0
  54. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/requirements.txt +0 -0
  55. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_autofix1/README.rst +0 -0
  56. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_autofix1/__init__.py +0 -0
  57. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_autofix1/__manifest__.py +0 -0
  58. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_autofix1/demo/demo.xml +0 -0
  59. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_autofix1/models/__init__.py +0 -0
  60. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_autofix1/models/models.py +0 -0
  61. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_autofix1/security/ir.model.access.csv +0 -0
  62. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_autofix1/views/views.xml +0 -0
  63. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_example1/README.rst +0 -0
  64. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_example1/__init__.py +0 -0
  65. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_example1/__manifest__.py +0 -0
  66. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_example1/deactivate.jinja +0 -0
  67. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_example1/demo/demo.xml +0 -0
  68. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_example1/models/models.py +0 -0
  69. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_example1/security/ir.model.access.csv +0 -0
  70. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_example1/static/src/js/example.js +0 -0
  71. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_example1/views/views.xml +0 -0
  72. {pre_commit_vauxoo-8.3.0/resources/module_example1/models → pre_commit_vauxoo-8.3.2/resources/module_uninstallable}/__init__.py +0 -0
  73. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_uninstallable/__manifest__.py +0 -0
  74. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_uninstallable/models/__init__.py +0 -0
  75. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_uninstallable/models/non_install.py +0 -0
  76. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_warnings1/README.rst +0 -0
  77. {pre_commit_vauxoo-8.3.0/resources/module_uninstallable → pre_commit_vauxoo-8.3.2/resources/module_warnings1}/__init__.py +0 -0
  78. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_warnings1/__manifest__.py +0 -0
  79. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_warnings1/demo/demo.xml +0 -0
  80. {pre_commit_vauxoo-8.3.0/resources/module_warnings1 → pre_commit_vauxoo-8.3.2/resources/module_warnings1/models}/__init__.py +0 -0
  81. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_warnings1/models/models.py +0 -0
  82. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_warnings1/security/ir.model.access.csv +0 -0
  83. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/resources/module_warnings1/views/views.xml +0 -0
  84. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/setup.cfg +0 -0
  85. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/__main__.py +0 -0
  86. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.editorconfig +0 -0
  87. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.eslintrc.config.mjs +0 -0
  88. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.isort.cfg +0 -0
  89. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.markdownlint-autofix.yaml.jinja +0 -0
  90. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.oca_hooks-autofix.cfg.jinja +0 -0
  91. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.oca_hooks.cfg.jinja +0 -0
  92. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.prettierrc.config.cjs.jinja +0 -0
  93. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/.pylintrc-experimental.jinja +0 -0
  94. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/doc8.ini +0 -0
  95. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/pyproject.toml.jinja +0 -0
  96. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/{% if not use_ruff %}.pre-commit-config-autofix.yaml{% endif %}.jinja +0 -0
  97. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}.pre-commit-config-autofix.yaml{% endif %}.jinja +0 -0
  98. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/cfg/{% if use_ruff %}.ruff-autofix.toml{% endif %}.jinja +0 -0
  99. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/git_hook_pre_commit +0 -0
  100. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/hooks/__init__.py +0 -0
  101. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/hooks/check_commit_msg.py +0 -0
  102. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/hooks/check_deactivate_jinja.py +0 -0
  103. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo/logging_colored.py +0 -0
  104. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo.egg-info/dependency_links.txt +0 -0
  105. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo.egg-info/entry_points.txt +0 -0
  106. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo.egg-info/not-zip-safe +0 -0
  107. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo.egg-info/requires.txt +0 -0
  108. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/src/pre_commit_vauxoo.egg-info/top_level.txt +0 -0
  109. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/tests/diffs/module_autofix1_expected_10.diff +0 -0
  110. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/tests/diffs/module_autofix1_expected_20.diff +0 -0
  111. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/tests/diffs/module_autofix1_expected_30.diff +0 -0
  112. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/tox.ini +0 -0
  113. {pre_commit_vauxoo-8.3.0 → pre_commit_vauxoo-8.3.2}/variables.sh +0 -0
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 8.3.0
2
+ current_version = 8.3.2
3
3
  commit = True
4
4
  tag = True
5
5
  sign_tags = True
@@ -5,6 +5,9 @@ source = src
5
5
  source = src
6
6
  parallel = true
7
7
  context = ${{COVERAGE_CONTEXT}}
8
+ # "sysmon" is the default core since python3.14 but it does not support the dynamic
9
+ # contexts set by "pytest --cov-context=test" raising a CoverageWarning for each test
10
+ core = ctrace
8
11
 
9
12
  [report]
10
13
  show_missing = true
@@ -1,6 +1,20 @@
1
1
  CHANGES
2
2
  =======
3
3
 
4
+ v8.3.2
5
+ ------
6
+
7
+ * Bump version: 8.3.1 → 8.3.2
8
+ * [IMP] cfg: Migrate to ruff the flake8/pylint checks already implemented in it (#250)
9
+ * [IMP] cfg: Enable pylint --jobs=3 using pylint-odoo v10.0.9 (#251)
10
+
11
+ v8.3.1
12
+ ------
13
+
14
+ * Bump version: 8.3.0 → 8.3.1
15
+ * [FIX] coveragerc: Set "core=ctrace" to support dynamic contexts
16
+ * [IMP] bandit-optional: Allow html\_sanitize calls for markupsafe B704
17
+
4
18
  v8.3.0
5
19
  ------
6
20
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pre-commit-vauxoo
3
- Version: 8.3.0
3
+ Version: 8.3.2
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
@@ -215,9 +215,13 @@ Full --help command result:
215
215
  README.rst, change py _('translation')
216
216
  to self.env._('translation'), rm manifest
217
217
  superfluous keys, rm field-string-redundant)
218
- 🟢 3. ESLint 🟢 4. Black / Autoflake 🟢 5. pre-
219
- commit framework 🟢 6. Pylint/pylint-odoo 🟢
220
- 7. flake8
218
+ 🟢 3. ESLint 🟢 4. Black / Autoflake (30 →
219
+ Use ruff instead. It also migrates to ruff
220
+ the mandatory and optional pylint/flake8
221
+ checks already implemented in ruff,
222
+ disabling them from the original tool) 🟢 5.
223
+ pre-commit framework 🟢 6. Pylint/pylint-
224
+ odoo 🟢 7. flake8
221
225
 
222
226
  ⚠️ Higher values or empty valuesmay
223
227
  introduce formatting changes, stricter
@@ -295,6 +299,20 @@ Note, to combine the coverage data from all the tox environments run:
295
299
  CHANGES
296
300
  =======
297
301
 
302
+ v8.3.2
303
+ ------
304
+
305
+ * Bump version: 8.3.1 → 8.3.2
306
+ * [IMP] cfg: Migrate to ruff the flake8/pylint checks already implemented in it (#250)
307
+ * [IMP] cfg: Enable pylint --jobs=3 using pylint-odoo v10.0.9 (#251)
308
+
309
+ v8.3.1
310
+ ------
311
+
312
+ * Bump version: 8.3.0 → 8.3.1
313
+ * [FIX] coveragerc: Set "core=ctrace" to support dynamic contexts
314
+ * [IMP] bandit-optional: Allow html\_sanitize calls for markupsafe B704
315
+
298
316
  v8.3.0
299
317
  ------
300
318
 
@@ -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.0.svg
53
+ .. |commits-since| image:: https://img.shields.io/github/commits-since/Vauxoo/pre-commit-vauxoo/v8.3.2.svg
54
54
  :alt: Commits since latest release
55
- :target: https://github.com/Vauxoo/pre-commit-vauxoo/compare/v8.3.0...main
55
+ :target: https://github.com/Vauxoo/pre-commit-vauxoo/compare/v8.3.2...main
56
56
 
57
57
 
58
58
 
@@ -216,9 +216,13 @@ Full --help command result:
216
216
  README.rst, change py _('translation')
217
217
  to self.env._('translation'), rm manifest
218
218
  superfluous keys, rm field-string-redundant)
219
- 🟢 3. ESLint 🟢 4. Black / Autoflake 🟢 5. pre-
220
- commit framework 🟢 6. Pylint/pylint-odoo 🟢
221
- 7. flake8
219
+ 🟢 3. ESLint 🟢 4. Black / Autoflake (30 →
220
+ Use ruff instead. It also migrates to ruff
221
+ the mandatory and optional pylint/flake8
222
+ checks already implemented in ruff,
223
+ disabling them from the original tool) 🟢 5.
224
+ pre-commit framework 🟢 6. Pylint/pylint-
225
+ odoo 🟢 7. flake8
222
226
 
223
227
  ⚠️ Higher values or empty valuesmay
224
228
  introduce formatting changes, stricter
@@ -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.0"
21
+ version = release = "8.3.2"
22
22
 
23
23
  pygments_style = "trac"
24
24
  templates_path = ["."]
@@ -0,0 +1,2 @@
1
+ from . import models
2
+ from . import markupsafe_sanitized
@@ -0,0 +1,12 @@
1
+ from markupsafe import Markup
2
+
3
+ from odoo.tools import html_sanitize
4
+
5
+
6
+ def body2markup(body):
7
+ """Build a HTML body for 'message_post' without raising bandit B704
8
+
9
+ Markup() is mandatory since 'message_post' escapes anything that is not a
10
+ Markup object, so the value is sanitized instead of escaped
11
+ """
12
+ return Markup(html_sanitize(body))
@@ -0,0 +1,108 @@
1
+ """Use cases of the optional checks migrated from pylint/flake8+bugbear to ruff.
2
+
3
+ Each case must be reported:
4
+ - before the ruff migration: by "pylint optional checks" or "flake8 + bugbear optional checks"
5
+ - after the ruff migration: by "ruff optional checks" (see .config/.ruff-optional.toml)
6
+
7
+ It is stored under "tests/data/" since that path is excluded from the autofixes
8
+ so the use cases are not autofixed before being reported by the linters.
9
+ The cases must not be reported by any mandatory check.
10
+ """
11
+
12
+ import datetime
13
+
14
+ # implicit-str-concat (pylint) -> single-line-implicit-string-concatenation (ruff ISC001)
15
+ IMPLICIT_CONCAT = "implicit" "concatenation"
16
+
17
+ # redundant-u-string-prefix (pylint) -> unicode-kind-prefix (ruff UP025)
18
+ UNICODE_PREFIX = u"unicode prefix"
19
+
20
+ # E242 tab after ',' (flake8) -> tab-after-comma (ruff E242)
21
+ TAB_AFTER_COMMA = ("first", "second")
22
+
23
+
24
+ def bad_docstring_quotes_use_case(value):
25
+ 'bad-docstring-quotes (pylint) -> triple-single-quotes (ruff D300)'
26
+ return value
27
+
28
+
29
+ def dict_literal_use_case():
30
+ # use-dict-literal (pylint) -> unnecessary-collection-call (ruff C408)
31
+ return dict(one=1)
32
+
33
+
34
+ def print_use_case(value):
35
+ # print-used (pylint) -> print (ruff T201)
36
+ print(value)
37
+
38
+
39
+ def except_pass_use_case(value):
40
+ # except-pass (pylint) -> try-except-pass (ruff S110)
41
+ try:
42
+ value = int(value)
43
+ except ValueError:
44
+ pass
45
+ return value
46
+
47
+
48
+ def compare_empty_string_use_case(name):
49
+ # use-implicit-booleaness-not-comparison-to-string (pylint) -> compare-to-empty-string (ruff PLC1901)
50
+ if name == "":
51
+ return "empty"
52
+ return name
53
+
54
+
55
+ def ambiguous_variable_use_case(items):
56
+ # E741 ambiguous variable name (flake8) -> ambiguous-variable-name (ruff E741)
57
+ total = 0
58
+ for l in items: # pylint: disable=invalid-name
59
+ total += l
60
+ return total
61
+
62
+
63
+ def function_call_default_use_case(when=datetime.datetime.now()):
64
+ # B008 (flake8-bugbear) -> function-call-in-default-argument (ruff B008)
65
+ return when
66
+
67
+
68
+ def assert_false_use_case():
69
+ # B011 (flake8-bugbear) -> assert-false (ruff B011)
70
+ assert False, "assert False use case"
71
+
72
+
73
+ def too_complex_use_case(number):
74
+ # too-complex (pylint mccabe max-complexity=15) -> complex-structure (ruff C901)
75
+ total = 0
76
+ if number % 2:
77
+ total += 2
78
+ if number % 3:
79
+ total += 3
80
+ if number % 5:
81
+ total += 5
82
+ if number % 7:
83
+ total += 7
84
+ if number % 11:
85
+ total += 11
86
+ if number % 13:
87
+ total += 13
88
+ if number % 17:
89
+ total += 17
90
+ if number % 19:
91
+ total += 19
92
+ if number % 23:
93
+ total += 23
94
+ if number % 29:
95
+ total += 29
96
+ if number % 31:
97
+ total += 31
98
+ if number % 37:
99
+ total += 37
100
+ if number % 41:
101
+ total += 41
102
+ if number % 43:
103
+ total += 43
104
+ if number % 47:
105
+ total += 47
106
+ if number % 53:
107
+ total += 53
108
+ return total
@@ -37,7 +37,7 @@ def read(*names, **kwargs):
37
37
 
38
38
  setup(
39
39
  name="pre-commit-vauxoo",
40
- version="8.3.0",
40
+ version="8.3.2",
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.2"
@@ -1,11 +1,22 @@
1
- [bandit]
2
- exclude = tests
1
+ exclude_dirs:
2
+ - tests
3
3
 
4
4
  # B608: hardcoded_sql_expressions they are considered from pylint-odoo
5
5
  # B313,B314,B315,B316,B317,B318,B319,B405,B406,B407,B408,B409: defusedxml checks
6
6
  # Odoo's team via inbox twitter is not convinced to repair them and the entire Odoo is raising these checks
7
- # B704: It is already enabled from .bandit-optional
8
- skips = B608,B313,B314,B315,B316,B317,B318,B319,B405,B406,B407,B408,B409,B704
9
- format = custom
10
- msg-template={relpath}:{line}:{col} {msg} - [{test_id}] - ({severity})
11
- quiet=True
7
+ # B704: It is already enabled from .bandit-optional.yml
8
+ skips:
9
+ - B608
10
+ - B313
11
+ - B314
12
+ - B315
13
+ - B316
14
+ - B317
15
+ - B318
16
+ - B319
17
+ - B405
18
+ - B406
19
+ - B407
20
+ - B408
21
+ - B409
22
+ - B704
@@ -0,0 +1,15 @@
1
+ exclude_dirs:
2
+ - tests
3
+
4
+ # B704:markupsafe_markup_xss more info https://github.com/OCA/pylint-odoo/pull/578
5
+ tests:
6
+ - B704
7
+
8
+ # Markup() is required to post HTML in Odoo (mail_thread.message_post() runs
9
+ # escape(body) and keeps it as is only for Markup objects), so the value can not
10
+ # simply be escaped. Wrapping the value with html_sanitize() is the safe way to
11
+ # build it, so it is whitelisted instead of forcing "# nosec" comments.
12
+ markupsafe_xss:
13
+ allowed_calls:
14
+ - odoo.tools.html_sanitize
15
+ - odoo.tools.mail.html_sanitize
@@ -1,6 +1,20 @@
1
1
  [flake8]
2
2
  max-line-length = 119
3
3
  jobs = 0
4
+ {% if use_ruff -%}
5
+ # The E,W,F and most of the bugbear (B) checks were migrated to ruff
6
+ # (.config/.ruff.toml for the mandatory ones and .config/.ruff-optional.toml for the optional ones)
7
+ # Only the bugbear checks without a ruff implementation keep running here: B906, B908,
8
+ # B950 (line length with +10% tolerance) and any future bugbear check
9
+ # B = bugbear
10
+ # B9 = bugbear opinionated (incl line length +10% tolerance)
11
+ select = B,B9
12
+ # - B001 is covered by ruff E722 and B902 by ruff N804/N805 (both mandatory .config/.ruff.toml)
13
+ # - B912: map(strict=True) only works in python >= 3.14 (same reason as B905)
14
+ # - B023,B024,B036,B904,B905,B907 were already ignored before the ruff migration (see comments below)
15
+ # - The remaining B0xx/B9xx checks are implemented in ruff (.config/.ruff-optional.toml)
16
+ ignore = B001,B002,B003,B004,B005,B006,B007,B008,B009,B010,B011,B012,B013,B014,B015,B016,B017,B018,B019,B020,B021,B022,B023,B024,B025,B026,B027,B028,B029,B030,B031,B032,B033,B034,B035,B036,B039,B901,B902,B903,B904,B905,B907,B909,B911,B912
17
+ {%- else -%}
4
18
  # B = bugbear
5
19
  # B9 = bugbear opinionated (incl line length +10% tolerance)
6
20
  select = C,E,F,W,B,B9
@@ -23,3 +37,4 @@ ignore = B024,B036,E203,E501,W503,W504,E241,B023,E226,B904,B905,B907,E123,E275
23
37
  per-file-ignores =
24
38
  __init__.py:F401
25
39
  __manifest__.py:B018
40
+ {%- endif %}
@@ -1,4 +1,12 @@
1
1
  [flake8]
2
+ {% if use_ruff -%}
3
+ # The pyflakes (F) and most of the pycodestyle (E,W) checks were migrated to ruff (.config/.ruff.toml)
4
+ # Only the continuation-line indentation rules (E12x/E13x) and E704 keep running here
5
+ # since ruff does not implement them https://github.com/astral-sh/ruff/issues/2402
6
+ select = E12,E13,E704
7
+ # E123,E133 keep being ignored (same as before the ruff migration)
8
+ ignore = E123,E133
9
+ {%- else -%}
2
10
  # B024: Odoo is not common to use ABC Classes not big deal to ignore it.
3
11
  # B036: Don't except `BaseException` unless you plan to re-raise it. (covered by pylint)
4
12
  # E123,E133,E226,E241,E242 are ignored by default by pep8 and flake8
@@ -10,7 +18,8 @@
10
18
  # E741 do not use variables named ‘l’, ‘O’, or ‘I’
11
19
  # chunk = records[index : index + chunk_size]
12
20
  ignore = B024,B036,E123,E133,E203,E226,E241,E242,E501,E741,F811,F601,W503,W504
13
- max-line-length = 119
14
21
  per-file-ignores=
15
22
  __init__.py:F401
23
+ {%- endif %}
24
+ max-line-length = 119
16
25
  jobs = 0
@@ -29,7 +29,7 @@ default_language_version:
29
29
  repos:
30
30
  - repo: https://github.com/OCA/pylint-odoo
31
31
  {%- if pylint_matrix_value >= 20 %}
32
- rev: v10.0.8
32
+ rev: v10.0.9
33
33
  {%- else %}
34
34
  rev: v9.3.24
35
35
  {%- endif %}
@@ -39,8 +39,9 @@ repos:
39
39
  args:
40
40
  - --rcfile=.config/.pylintrc-optional
41
41
  - --disable={{ pylint_disable_checks | join(",") if pylint_disable_checks else "R0000" }}
42
- # uncomment after fix https://github.com/OCA/pylint-odoo/pull/512
43
- # - --jobs=0 # 0 will auto-detect the number of processors available to use
42
+ {%- if pylint_matrix_value >= 20 %}
43
+ - --jobs=3
44
+ {%- endif %}
44
45
  - repo: https://github.com/OCA/odoo-pre-commit-hooks
45
46
  {%- if oca_hooks_matrix_value >= 20 %}
46
47
  rev: v0.2.24
@@ -66,6 +67,15 @@ repos:
66
67
  language: python
67
68
  pass_filenames: false
68
69
  always_run: true
70
+ {%- if use_ruff %}
71
+ - repo: https://github.com/astral-sh/ruff-pre-commit
72
+ rev: v0.16.0
73
+ hooks:
74
+ - id: ruff-check
75
+ name: ruff optional checks
76
+ args:
77
+ - --config=.config/.ruff-optional.toml
78
+ {%- endif %}
69
79
  - repo: https://github.com/PyCQA/flake8
70
80
  {%- if flake8_matrix_value >= 20 %}
71
81
  rev: 7.3.0
@@ -89,7 +99,12 @@ repos:
89
99
  name: bandit optional
90
100
  verbose: True
91
101
  args:
92
- - --ini=.config/.bandit-optional
102
+ # The YAML format is used instead of the INI one since it is the only
103
+ # one supporting per-plugin options, e.g. "markupsafe_xss"
104
+ - --configfile=.config/.bandit-optional.yml
105
+ - --format=custom
106
+ - "--msg-template={relpath}:{line}:{col} {msg} - [{test_id}] - ({severity})"
107
+ - --quiet
93
108
  # reduce the INFO logger
94
109
  require_serial: true
95
110
  - repo: https://github.com/PyCQA/bandit
@@ -100,12 +115,15 @@ repos:
100
115
  verbose: True
101
116
  args:
102
117
  - --exit-zero
103
- - --ini=.config/.bandit-experimental
118
+ - --configfile=.config/.bandit-experimental.yml
119
+ - --format=custom
120
+ - "--msg-template={relpath}:{line}:{col} {msg} - [{test_id}] - ({severity})"
121
+ - --quiet
104
122
  # reduce the INFO logger
105
123
  require_serial: true
106
124
  - repo: https://github.com/OCA/pylint-odoo
107
125
  {%- if pylint_matrix_value >= 20 %}
108
- rev: v10.0.8
126
+ rev: v10.0.9
109
127
  {%- else %}
110
128
  rev: v9.3.24
111
129
  {%- endif %}
@@ -116,3 +134,6 @@ repos:
116
134
  args:
117
135
  - --rcfile=.config/.pylintrc-experimental
118
136
  - --exit-zero
137
+ {%- if pylint_matrix_value >= 20 %}
138
+ - --jobs=3
139
+ {%- endif %}
@@ -27,6 +27,15 @@ default_language_version:
27
27
  python: python3
28
28
  node: "24.13.0"
29
29
  repos:
30
+ {%- if use_ruff %}
31
+ - repo: https://github.com/astral-sh/ruff-pre-commit
32
+ rev: v0.16.0
33
+ hooks:
34
+ - id: ruff-check
35
+ name: ruff mandatory checks
36
+ args:
37
+ - --config=.config/.ruff.toml
38
+ {%- endif %}
30
39
  - repo: https://github.com/PyCQA/flake8
31
40
  {%- if flake8_matrix_value >= 20 %}
32
41
  rev: 7.3.0
@@ -40,7 +49,7 @@ repos:
40
49
  - --config=.config/.flake8
41
50
  - repo: https://github.com/OCA/pylint-odoo
42
51
  {%- if pylint_matrix_value >= 20 %}
43
- rev: v10.0.8
52
+ rev: v10.0.9
44
53
  {%- else %}
45
54
  rev: v9.3.24
46
55
  {%- endif %}
@@ -50,8 +59,9 @@ repos:
50
59
  args:
51
60
  - --rcfile=.config/.pylintrc
52
61
  - --disable={{ pylint_disable_checks | join(",") if pylint_disable_checks else "R0000" }}
53
- # uncomment after fix https://github.com/OCA/pylint-odoo/pull/512
54
- # - --jobs=0 # 0 will auto-detect the number of processors available to use
62
+ {%- if pylint_matrix_value >= 20 %}
63
+ - --jobs=3
64
+ {%- endif %}
55
65
  - repo: https://github.com/pre-commit/mirrors-eslint
56
66
  rev: v9.39.1
57
67
  hooks:
@@ -29,18 +29,12 @@ disable=all,unknown-option-value
29
29
  enable=attribute-deprecated,
30
30
  attribute-string-redundant,
31
31
  bad-builtin-groupby,
32
- bad-docstring-quotes,
33
32
  consider-merging-classes-inherited,
34
- consider-using-generator,
35
33
  context-overridden,
36
34
  deprecated-method,
37
35
  deprecated-odoo-model-method,
38
36
  deprecated-pragma,
39
- docstring-first-line-empty,
40
- eval-used,
41
- except-pass,
42
37
  external-request-timeout,
43
- implicit-str-concat,
44
38
  invalid-commit,
45
39
  license-allowed,
46
40
  manifest-author-string,
@@ -58,12 +52,9 @@ enable=attribute-deprecated,
58
52
  missing-return,
59
53
  odoo-addons-relative-import,
60
54
  odoo-exception-warning,
61
- print-used,
62
- redundant-u-string-prefix,
63
55
  renamed-field-parameter,
64
56
  resource-not-exist,
65
57
  sql-injection,
66
- too-complex,
67
58
  translation-contains-variable,
68
59
  translation-field,
69
60
  translation-required,
@@ -74,13 +65,26 @@ enable=attribute-deprecated,
74
65
  translation-too-few-args,
75
66
  translation-too-many-args,
76
67
  translation-unsupported-format,
77
- use-dict-literal,
78
- use-implicit-booleaness-not-comparison-to-string,
79
68
  use-implicit-booleaness-not-comparison-to-zero,
80
69
  use-symbolic-message-instead,
81
70
  use-vim-comment,
82
71
  useless-parent-delegation,
83
72
  website-manifest-key-not-valid-uri
73
+ {%- if not use_ruff %},
74
+ # The following checks are migrated to ruff when it is enabled
75
+ # (see .config/.ruff.toml for eval-used and .config/.ruff-optional.toml for the rest)
76
+ bad-docstring-quotes, # ruff D300
77
+ consider-using-generator, # ruff C419 with preview (mandatory .ruff.toml)
78
+ docstring-first-line-empty, # ruff D212
79
+ eval-used, # ruff S307
80
+ except-pass, # ruff S110
81
+ implicit-str-concat, # ruff ISC001
82
+ print-used, # ruff T201
83
+ redundant-u-string-prefix, # ruff UP025
84
+ too-complex, # ruff C901
85
+ use-dict-literal, # ruff C408
86
+ use-implicit-booleaness-not-comparison-to-string # ruff PLC1901
87
+ {%- endif %}
84
88
 
85
89
  [REPORTS]
86
90
  msg-template={path}:{line}:{column}: ({symbol}) {msg}