Files
Odoo-Build/.pre-commit-config.yaml
Janik von Rotz b0ba6ae190 feat(snippets): add dedicated lint-snippets script and pre-commit hook, remove invalid snippets
Introduce a new `lint-snippets` Python script to validate snippet filenames (enforcing mint_system.module.[view/action].xml format with 4 dots/5 segments and alphanumeric/underscore characters) and XML structure. Add pre-commit hook to automatically run linting on staged snippet files. Remove 6 invalid snippets that failed linting: product search terms, bank statement kanban, DIN5008 header, and purchase report styling snippets. Update task script to use the new linting script instead of inline validation.
2026-03-05 18:37:01 +01:00

30 lines
754 B
YAML

repos:
- repo: local
hooks:
- id: prettier
name: prettier (with plugin-xml)
entry: prettier
args:
- --write
- --list-different
- --ignore-unknown
types: [text]
files: ^((bin|snippets)/).*$
language: node
additional_dependencies:
- "prettier@3.3.3"
- "@prettier/plugin-xml@3.4.1"
- id: lint-snippets
name: lint-snippets
entry: ./bin/lint-snippets
language: python
types: [text]
files: ^snippets/.*\.xml$
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
- id: ruff
name: ruff
args: [--fix]
types_or: [python]
files: ^bin/