ollama4j/pre-commit-config.yaml
amithkoujalgi 7756eed9a0
Add pre-commit configuration file
Introduce a pre-commit-config.yaml to automate code quality checks and enforce best practices. Includes hooks for file validation, formatting, and commit message standardization, as well as Java-specific quality tools. This ensures consistent coding standards and reduces manual errors.
2025-03-11 09:29:57 +05:30

36 lines
829 B
YAML

repos:
# pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
hooks:
- id: check-added-large-files
- id: no-commit-to-branch
- id: check-toml
- id: check-yaml
- id: check-json
- id: check-xml
- id: end-of-file-fixer
exclude: \.json$
files: \.py$
- id: trailing-whitespace
- id: mixed-line-ending
# for commit message formatting
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.1.1
hooks:
- id: commitizen
stages: [commit-msg]
# for java code quality
- repo: https://github.com/gherynos/pre-commit-java
rev: v0.2.1
hooks:
- id: pmd
exclude: /test/
- id: cpd
exclude: /test/
- id: checkstyle
exclude: /test/
# ...