|
| 1 | +exclude: | |
| 2 | + (?x) |
| 3 | + # NOT INSTALLABLE ADDONS |
| 4 | + # END NOT INSTALLABLE ADDONS |
| 5 | + # Files and folders generated by bots, to avoid loops |
| 6 | + ^setup/|/static/description/index\.html$| |
| 7 | + # We don't want to mess with tool-generated files |
| 8 | + .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs| |
| 9 | + # Maybe reactivate this when all README files include prettier ignore tags? |
| 10 | + ^README\.md$| |
| 11 | + # Library files can have extraneous formatting (even minimized) |
| 12 | + /static/(src/)?lib/| |
| 13 | + # Repos using Sphinx to generate docs don't need prettying |
| 14 | + ^docs/_templates/.*\.html$| |
| 15 | + # Don't bother non-technical authors with formatting issues in docs |
| 16 | + readme/.*\.(rst|md)$| |
| 17 | + # Ignore build and dist directories in addons |
| 18 | + /build/|/dist/| |
| 19 | + # Ignore test files in addons |
| 20 | + /tests/samples/.*| |
| 21 | + # You don't usually want a bot to modify your legal texts |
| 22 | + (LICENSE.*|COPYING.*) |
| 23 | +default_language_version: |
| 24 | + python: python3 |
| 25 | + node: "22.9.0" |
| 26 | +repos: |
| 27 | + - repo: local |
| 28 | + hooks: |
| 29 | + # These files are most likely copier diff rejection junks; if found, |
| 30 | + # review them manually, fix the problem (if needed) and remove them |
| 31 | + - id: forbidden-files |
| 32 | + name: forbidden files |
| 33 | + entry: found forbidden files; remove them |
| 34 | + language: fail |
| 35 | + files: "\\.rej$" |
| 36 | + - id: en-po-files |
| 37 | + name: en.po files cannot exist |
| 38 | + entry: found a en.po file |
| 39 | + language: fail |
| 40 | + files: '[a-zA-Z0-9_]*/i18n/en\.po$' |
| 41 | + - repo: https://github.com/sbidoul/whool |
| 42 | + rev: v1.2 |
| 43 | + hooks: |
| 44 | + - id: whool-init |
| 45 | + - repo: https://github.com/oca/maintainer-tools |
| 46 | + rev: bf9ecb9938b6a5deca0ff3d870fbd3f33341fded |
| 47 | + hooks: |
| 48 | + # update the NOT INSTALLABLE ADDONS section above |
| 49 | + - id: oca-update-pre-commit-excluded-addons |
| 50 | + - id: oca-fix-manifest-website |
| 51 | + args: ["https://github.com/OdooDataFlow/addons"] |
| 52 | + - id: oca-gen-addon-readme |
| 53 | + args: |
| 54 | + - --addons-dir=. |
| 55 | + - --branch=18.0 |
| 56 | + - --org-name=OdooDataFlow |
| 57 | + - --repo-name=addons |
| 58 | + - --if-source-changed |
| 59 | + - --keep-source-digest |
| 60 | + - --convert-fragments-to-markdown |
| 61 | + - id: oca-gen-external-dependencies |
| 62 | + - repo: https://github.com/OCA/odoo-pre-commit-hooks |
| 63 | + rev: v0.1.1 |
| 64 | + hooks: |
| 65 | + - id: oca-checks-odoo-module |
| 66 | + - id: oca-checks-po |
| 67 | + args: |
| 68 | + - --disable=po-pretty-format |
| 69 | + - repo: local |
| 70 | + hooks: |
| 71 | + - id: prettier |
| 72 | + name: prettier (with plugin-xml) |
| 73 | + entry: prettier |
| 74 | + args: |
| 75 | + - --write |
| 76 | + - --list-different |
| 77 | + - --ignore-unknown |
| 78 | + types: [text] |
| 79 | + files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$ |
| 80 | + language: node |
| 81 | + additional_dependencies: |
| 82 | + |
| 83 | + |
| 84 | + - repo: local |
| 85 | + hooks: |
| 86 | + - id: eslint |
| 87 | + name: eslint |
| 88 | + entry: eslint |
| 89 | + args: |
| 90 | + - --color |
| 91 | + - --fix |
| 92 | + verbose: true |
| 93 | + types: [javascript] |
| 94 | + language: node |
| 95 | + additional_dependencies: |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 100 | + rev: v4.6.0 |
| 101 | + hooks: |
| 102 | + - id: trailing-whitespace |
| 103 | + # exclude autogenerated files |
| 104 | + exclude: /README\.rst$|\.pot?$ |
| 105 | + - id: end-of-file-fixer |
| 106 | + # exclude autogenerated files |
| 107 | + exclude: /README\.rst$|\.pot?$ |
| 108 | + - id: debug-statements |
| 109 | + - id: fix-encoding-pragma |
| 110 | + args: ["--remove"] |
| 111 | + - id: check-case-conflict |
| 112 | + - id: check-docstring-first |
| 113 | + - id: check-executables-have-shebangs |
| 114 | + - id: check-merge-conflict |
| 115 | + # exclude files where underlines are not distinguishable from merge conflicts |
| 116 | + exclude: /README\.rst$|^docs/.*\.rst$ |
| 117 | + - id: check-symlinks |
| 118 | + - id: check-xml |
| 119 | + - id: mixed-line-ending |
| 120 | + args: ["--fix=lf"] |
| 121 | + - repo: https://github.com/astral-sh/ruff-pre-commit |
| 122 | + rev: v0.9.9 |
| 123 | + hooks: |
| 124 | + - id: ruff |
| 125 | + args: [--fix, --exit-non-zero-on-fix] |
| 126 | + - id: ruff-format |
| 127 | + - repo: https://github.com/OCA/pylint-odoo |
| 128 | + rev: v9.3.2 |
| 129 | + hooks: |
| 130 | + - id: pylint_odoo |
| 131 | + name: pylint with optional checks |
| 132 | + args: |
| 133 | + - --rcfile=.pylintrc |
| 134 | + - --exit-zero |
| 135 | + verbose: true |
| 136 | + - id: pylint_odoo |
| 137 | + args: |
| 138 | + - --rcfile=.pylintrc-mandatory |
0 commit comments