-
Notifications
You must be signed in to change notification settings - Fork 722
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
75 lines (69 loc) · 2.48 KB
/
.pre-commit-config.yaml
File metadata and controls
75 lines (69 loc) · 2.48 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
repos:
- repo: https://github.com/kynan/nbstripout
rev: 34071b78c181af3bf5af955c1426466e096fc3db #0.9.1
hooks:
- id: nbstripout
args: [--keep-output, '--extra-keys=metadata.kernelspec']
files: ^doc/.*\.ipynb$
- repo: local
hooks:
- id: sanitize-notebook-paths
name: Sanitize Notebook Paths
entry: python ./build_scripts/sanitize_notebook_paths.py
language: python
files: ^doc.*\.(ipynb)$
- id: strip-notebook-progress-bars
name: Strip Notebook Progress Bars
entry: python ./build_scripts/strip_notebook_progress_bars.py
language: python
files: ^doc.*\.(ipynb)$
- id: validate-docs
name: Validate Documentation Structure
entry: python ./build_scripts/validate_docs.py
language: python
files: ^(doc/.*\.(py|ipynb|md)|doc/myst\.yml)$
pass_filenames: false
additional_dependencies: ['pyyaml']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: NOTICE.txt
- id: end-of-file-fixer
exclude: NOTICE.txt
- id: check-yaml
- id: check-added-large-files
args: ["--maxkb=3072"] # Set limit to 3072 KB (3 MB) for displaying images in notebooks
- id: detect-private-key
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.4
hooks:
- id: ruff-format
- id: ruff-check
args: [--fix]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.9.1
hooks:
- id: nbqa-ruff
name: Ruff (Jupyter Notebooks)
args: [--fix]
- repo: local
hooks:
- id: check-links
name: Check Links in Python and md Files
entry: python ./build_scripts/check_links.py
language: python
files: ^doc.*\.(py|md)$
additional_dependencies: ['requests']
exclude: (release_process.md|git.md|^doc/deployment/|tests|pyrit/prompt_converter/morse_converter.py|.github|pyrit/prompt_converter/emoji_converter.py|pyrit/score/markdown_injection.py|^pyrit/datasets/|^pyrit/auxiliary_attacks/gcg/)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
name: mypy (strict)
files: &strict_modules ^pyrit/
exclude: ^pyrit/auxiliary_attacks/
args: [--install-types, --non-interactive, --ignore-missing-imports, --sqlite-cache, --cache-dir=.mypy_cache, --strict]
entry: mypy
language: system
types: [ python ]