2023-05-15 09:46:59 +00:00
|
|
|
exclude: '(api|chat|control)/migrations/.*'
|
2022-10-24 14:34:21 +00:00
|
|
|
repos:
|
|
|
|
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
|
2023-11-01 12:18:00 +00:00
|
|
|
rev: v4.5.0
|
2022-10-24 14:34:21 +00:00
|
|
|
hooks:
|
2023-02-22 15:55:51 +00:00
|
|
|
- id: check-merge-conflict
|
2022-10-24 14:34:21 +00:00
|
|
|
- id: check-yaml
|
|
|
|
- id: check-toml
|
|
|
|
- id: mixed-line-ending
|
|
|
|
args:
|
|
|
|
- '--fix=lf'
|
|
|
|
- id: trailing-whitespace
|
|
|
|
- id: pretty-format-json
|
2023-05-22 08:26:48 +00:00
|
|
|
exclude: ^frontend/
|
2022-10-24 14:34:21 +00:00
|
|
|
args:
|
|
|
|
- '--autofix'
|
|
|
|
- '--no-sort-keys'
|
2022-10-27 13:38:24 +00:00
|
|
|
- '--no-ensure-ascii'
|
2022-10-24 14:34:21 +00:00
|
|
|
- id: check-builtin-literals
|
|
|
|
- id: check-docstring-first
|
2023-02-21 17:33:52 +00:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
2023-05-22 08:26:48 +00:00
|
|
|
- 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'
|
2022-10-24 14:34:21 +00:00
|
|
|
- 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'
|
2024-01-09 01:22:50 +00:00
|
|
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
2024-01-16 17:20:37 +00:00
|
|
|
rev: v0.1.13
|
2024-01-09 01:22:50 +00:00
|
|
|
hooks:
|
|
|
|
- id: ruff
|
|
|
|
stages:
|
|
|
|
- commit
|
|
|
|
- merge-commit
|
|
|
|
language: system
|
|
|
|
args: [ --fix ]
|
|
|
|
types: [python]
|
|
|
|
- id: ruff-format
|
|
|
|
stages:
|
|
|
|
- commit
|
|
|
|
- merge-commit
|
|
|
|
language: system
|
|
|
|
types: [python]
|
|
|
|
|