forked from OpenBuilders/access-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
27 lines (24 loc) · 859 Bytes
/
.pre-commit-config.yaml
File metadata and controls
27 lines (24 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.1
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
files: ^backend/.*\.(py)$
# Run the formatter.
- id: ruff-format
files: ^backend/.*\.(py)$
# Add ESLint for frontend directory files.
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.21.0 # Use the desired eslint version.
hooks:
- id: eslint
name: eslint (frontend)
entry: bash -c 'cd frontend && npm run lint $(git diff --cached --name-only --diff-filter=ACM | grep -E "\.(js|ts|jsx|tsx)$" | grep "^frontend/" | sed "s|^frontend/||")'
language: system
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [ file ]
additional_dependencies: [ ]
args: [ "frontend" ]