robosats/.pre-commit-config.yaml
2024-10-19 15:33:55 +02:00

67 lines
1.9 KiB
YAML

exclude: '(api|chat|control)/migrations/.*'
repos:
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: check-yaml
- id: check-toml
- id: mixed-line-ending
args:
- '--fix=lf'
- id: trailing-whitespace
- id: pretty-format-json
exclude: ^frontend/|^mobile/
args:
- '--autofix'
- '--no-sort-keys'
- '--no-ensure-ascii'
- id: check-builtin-literals
- id: check-docstring-first
- repo: local
hooks:
- id: collect-phrases
name: Collect i18n phrases
stages:
- commit
- merge-commit
language: system
files: ^frontend/src/
types_or: [javascript, jsx, ts, tsx] # uses https://github.com/pre-commit/identify
entry: bash -c 'cd frontend/static/locales && python3 collect_phrases.py'
- id: prettier-frontend
name: prettier-frontend
stages:
- commit
- merge-commit
language: system
files: ^frontend/
types_or: [javascript, jsx, ts, tsx, css, markdown, json] # uses https://github.com/pre-commit/identify
entry: bash -c 'cd frontend && npm run format'
- id: prettier-mobile
name: prettier-mobile
stages:
- commit
- merge-commit
language: system
files: ^mobile/
types_or: [javascript, jsx, ts, tsx, css, markdown, json] # uses https://github.com/pre-commit/identify
entry: bash -c 'cd mobile && npm run format'
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.13
hooks:
- id: ruff
stages:
- commit
- merge-commit
language: system
args: [ --fix ]
types: [python]
- id: ruff-format
stages:
- commit
- merge-commit
language: system
types: [python]