forked from red-hat-data-services/red-hat-ai-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
75 lines (68 loc) · 2.1 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
75 lines (68 loc) · 2.1 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
66
67
68
69
70
71
72
73
74
75
# Pre-commit hooks for code quality, security, and secret scanning
# Install: pip install pre-commit && pre-commit install
# Run manually: pre-commit run --all-files
repos:
# Strip outputs from Jupyter notebooks
- repo: https://github.com/kynan/nbstripout
rev: 0.8.2
hooks:
- id: nbstripout
args:
- --keep-id
- --drop-empty-cells
- --extra-keys
- >-
metadata.widgets
cell.metadata.execution
cell.metadata.scrolled
cell.metadata.collapsed
# Python linting and formatting with Ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.4
hooks:
# Run the linter
- id: ruff
types_or: [python, pyi, jupyter]
args: [ --fix ]
# Run the formatter
- id: ruff-format
types_or: [python, pyi, jupyter]
# Markdown linting
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.45.0
hooks:
- id: markdownlint
# Secret scanning with Gitleaks
- repo: https://github.com/gitleaks/gitleaks
rev: v8.29.0
hooks:
- id: gitleaks
# Secret scanning with Talisman
- repo: https://github.com/thoughtworks/talisman
rev: v1.37.0
hooks:
- id: talisman-commit
entry: cmd --githook pre-commit
# Secret scanning with detect-secrets
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline', '--exclude-lines', 'HF_TOKEN|hf-hub-secret']
exclude: package.lock.json
verbose: true
# If this fails, see CONTRIBUTING.md for instructions on updating the baseline
# General code quality checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: check-case-conflict
- id: mixed-line-ending
- id: detect-private-key