-
Notifications
You must be signed in to change notification settings - Fork 873
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
123 lines (119 loc) · 3.83 KB
/
.pre-commit-config.yaml
File metadata and controls
123 lines (119 loc) · 3.83 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
default_language_version:
python: python3.11
exclude: '^\.internal/docs/.*' # exclude docs from pre-commit hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-symlinks
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
name: format end of file
- id: trailing-whitespace
name: format trailing whitespace
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
name: format prettier
- repo: https://github.com/psf/black
rev: 24.3.0
hooks:
- id: black-jupyter
name: format notebook black
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.4
hooks:
- id: nbqa-isort
name: format notebook isort
- repo: local
hooks:
- id: upgrade-nbformat
name: format nbformat upgrade
entry: .internal/pre_commit_tools/set_nbformat.py
language: python
files: \.ipynb$
additional_dependencies:
- "nbformat"
require_serial: true
- id: extra-nbstripout
name: format nbformat strip
entry: .internal/pre_commit_tools/extra_nbstripout.py
language: python
files: \.ipynb$
additional_dependencies:
- "nbformat"
require_serial: true
- id: verify-notebook-format-execution-count
name: format nbformat execution-count
language: pygrep
files: \.ipynb$
entry: '"execution_count": -'
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
- id: nbstripout
name: format nbformat nbstripout
args:
[
--keep-output,
--keep-count,
--drop-empty-cells,
--keep-metadata-keys=cell.metadata.scrolled,
]
- repo: local
hooks:
- id: verify-platform-links-nightly
name: Forbid links to nightly.platform
language: pygrep
files: \.ipynb$
exclude: (^|/)logical_qubits_by_alice_and_bob\.ipynb$
entry: https://nightly\.platform\.classiq\.io
- id: verify-platform-links-dev
name: Forbid links with dev version
language: pygrep
files: \.ipynb$
exclude: (^|/)logical_qubits_by_alice_and_bob\.ipynb$
entry: '[?&]version=[^ \t\n]*\.dev'
- id: verify-platform-links-old
name: Forbid links from older versions
language: pygrep
files: \.ipynb$
exclude: (^|/)logical_qubits_by_alice_and_bob\.ipynb$
entry: '"Opening:\s+https://'
- id: notebook-pre-commit
name: Validate naming notebooks
description: Ensure notebooks conventions
entry: .internal/pre_commit_tools/notebook_pre_commit_collection.py
language: python
files: \.ipynb$
additional_dependencies:
- "pyyaml==6.0"
require_serial: true
- id: qmod-pre-commit
name: Validate naming qmods
description: Ensure qmods conventions
entry: .internal/pre_commit_tools/qmod_pre_commit_collection.py
language: python
files: \.qmod$
additional_dependencies:
- "pyyaml==6.0"
require_serial: true
- id: validate-metadata-file
name: Validate Metadata file
description: Add file if non existant and validate value otherwise
entry: .internal/pre_commit_tools/metadata_validate.py
language: python
files: \.(qmod|ipynb)$
require_serial: true
- id: auto-add-tests
name: Auto add test
description: Automatically adding a test to new notebooks
entry: .internal/pre_commit_tools/auto_add_tests.py
language: python
files: \.ipynb$
require_serial: true