forked from CarterPerez-dev/Cybersecurity-Projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
65 lines (59 loc) · 2.18 KB
/
.pre-commit-config.yaml
File metadata and controls
65 lines (59 loc) · 2.18 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
repos:
# Python Backend Checks
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: ruff
name: ruff check (backend)
args: [--fix, --exit-non-zero-on-fix]
files: ^PROJECTS/api-security-scanner/backend/
exclude: ^PROJECTS/api-security-scanner/backend/(\.venv|__pycache__|\.pytest_cache)/
- repo: local
hooks:
- id: yapf
name: yapf format (backend)
entry: bash -c 'cd PROJECTS/api-security-scanner/backend && yapf -i -r -vv models/ repositories/ schemas/ scanners/ core/ factory/'
language: system
types: [python]
files: ^PROJECTS/api-security-scanner/backend/
pass_filenames: false
- id: mypy
name: mypy type check (backend)
entry: bash -c 'cd PROJECTS/api-security-scanner/backend && mypy .'
language: system
types: [python]
files: ^PROJECTS/api-security-scanner/backend/
pass_filenames: false
- id: pylint
name: pylint check (backend)
entry: bash -c 'cd PROJECTS/api-security-scanner/backend && pylint **/*.py'
language: system
types: [python]
files: ^PROJECTS/api-security-scanner/backend/
pass_filenames: false
# Frontend TypeScript/ESLint Checks
- id: eslint
name: eslint check (frontend)
entry: bash -c 'cd PROJECTS/api-security-scanner/frontend && npm run lint:eslint'
language: system
types_or: [ts, tsx, javascript, jsx]
files: ^PROJECTS/api-security-scanner/frontend/src/
pass_filenames: false
- id: typescript
name: TypeScript type check (frontend)
entry: bash -c 'cd PROJECTS/api-security-scanner/frontend && npm run lint:types'
language: system
types_or: [ts, tsx]
files: ^PROJECTS/api-security-scanner/frontend/src/
pass_filenames: false
# General File Checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-merge-conflict
- id: check-added-large-files
args: ['--maxkb=1000']