Add pre-commit framework
- Install pre-commit - Configure .pre-commit-config.yaml with: - ruff (lint + format) for Python - bandit for Python security - eslint for TypeScript - prettier for TypeScript - shared constants validation - Add Makefile targets: pre-commit, lint
This commit is contained in:
parent
521848217d
commit
d55382d16f
3 changed files with 49 additions and 1 deletions
41
.pre-commit-config.yaml
Normal file
41
.pre-commit-config.yaml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
repos:
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.14.0
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: [--fix]
|
||||
files: ^backend/
|
||||
- id: ruff-format
|
||||
files: ^backend/
|
||||
|
||||
- repo: https://github.com/PyCQA/bandit
|
||||
rev: 1.8.0
|
||||
hooks:
|
||||
- id: bandit
|
||||
args: [-c, backend/pyproject.toml, -r]
|
||||
files: ^backend/
|
||||
exclude: ^backend/(tests|\.venv)/
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: eslint
|
||||
name: ESLint
|
||||
entry: npm run lint --prefix frontend
|
||||
language: system
|
||||
files: ^frontend/.*\.(ts|tsx)$
|
||||
pass_filenames: false
|
||||
|
||||
- id: prettier
|
||||
name: Prettier
|
||||
entry: npm run format:check --prefix frontend
|
||||
language: system
|
||||
files: ^frontend/
|
||||
pass_filenames: false
|
||||
|
||||
- id: check-constants
|
||||
name: Check shared constants
|
||||
entry: bash -c 'cd backend && uv run python validate_constants.py'
|
||||
language: system
|
||||
files: shared/constants\.json$
|
||||
pass_filenames: false
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue