-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.pre-commit-config.yaml
53 lines (53 loc) · 1.74 KB
/
.pre-commit-config.yaml
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
# Apply to all files without commiting:
# pre-commit run --all-files
# Update this file:
# pre-commit autoupdate
repos:
# Various pre-commit hooks to have different checks before we version the code
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-ast
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
# Run Black code formatter
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- id: black-jupyter
# Run Black on Python code blocks in documentation files.
- repo: https://github.com/asottile/blacken-docs
rev: v1.8.0
hooks:
- id: blacken-docs
additional_dependencies: [black==21.12b0] # fix by this thread - https://github.com/adamchainz/blacken-docs/issues/141
# Clean jupyter notebook outputs - https://zhauniarovich.com/post/2020/2020-06-clearing-jupyter-output/
- repo: local
hooks:
- id: jupyter-nb-clear-output
name: jupyter-nb-clear-output
files: \.ipynb$
stages: [commit]
language: system
entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace
# Sort imports
# - repo: https://github.com/pycqa/isort
# rev: 5.6.4
# hooks:
# - id: isort
# args: ["--profile", "black", "--filter-files"]
# A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
# - repo: https://github.com/asottile/pyupgrade
# rev: v2.7.2
# hooks:
# - id: pyupgrade
# args: [--py36-plus]