Skip to content

Commit bc3949a

Browse files
authored
[MAINT]: Fold notebook header removal logic to nbstripout (microsoft#1550)
1 parent 8741624 commit bc3949a

2 files changed

Lines changed: 15 additions & 64 deletions

File tree

.pre-commit-config.yaml

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
repos:
22
- repo: https://github.com/kynan/nbstripout
3-
rev: 0.8.1
3+
rev: 34071b78c181af3bf5af955c1426466e096fc3db #0.9.1
44
hooks:
55
- id: nbstripout
6-
args:
7-
- '--keep-output'
6+
args: [--keep-output, '--extra-keys=metadata.kernelspec']
7+
files: ^doc/*\.(ipynb)$
88

99
- repo: local
1010
hooks:
11-
- id: remove-notebook-headers
12-
name: Remove Notebook Headers
13-
entry: python ./build_scripts/remove_notebook_headers.py
14-
language: python
15-
files: ^doc.*\.(ipynb)$
16-
- id: sanitize-notebook-paths
17-
name: Sanitize Notebook Paths
18-
entry: python ./build_scripts/sanitize_notebook_paths.py
19-
language: python
20-
files: ^doc.*\.(ipynb)$
11+
- id: sanitize-notebook-paths
12+
name: Sanitize Notebook Paths
13+
entry: python ./build_scripts/sanitize_notebook_paths.py
14+
language: python
15+
files: ^doc.*\.(ipynb)$
16+
- id: validate-docs
17+
name: Validate Documentation Structure
18+
entry: python ./build_scripts/validate_docs.py
19+
language: python
20+
files: ^(doc/.*\.(py|ipynb|md)|doc/myst\.yml)$
21+
pass_filenames: false
22+
additional_dependencies: ['pyyaml']
2123

2224
- repo: https://github.com/pre-commit/pre-commit-hooks
2325
rev: v5.0.0
@@ -66,23 +68,3 @@ repos:
6668
entry: mypy
6769
language: system
6870
types: [ python ]
69-
70-
- repo: local
71-
hooks:
72-
- id: remove-notebook-headers
73-
name: Remove Notebook Headers
74-
entry: python ./build_scripts/remove_notebook_headers.py
75-
language: python
76-
files: ^doc.*\.(ipynb)$
77-
- id: sanitize-notebook-paths
78-
name: Sanitize Notebook Paths
79-
entry: python ./build_scripts/sanitize_notebook_paths.py
80-
language: python
81-
files: ^doc.*\.(ipynb)$
82-
- id: validate-docs
83-
name: Validate Documentation Structure
84-
entry: python ./build_scripts/validate_docs.py
85-
language: python
86-
files: ^(doc/.*\.(py|ipynb|md)|doc/myst\.yml)$
87-
pass_filenames: false
88-
additional_dependencies: ['pyyaml']

build_scripts/remove_notebook_headers.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)