-
Notifications
You must be signed in to change notification settings - Fork 82
/
.pre-commit-config.yaml
63 lines (63 loc) · 2.14 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
54
55
56
57
58
59
60
61
62
63
# NOTE: The versions can be updated by calling
# pre-commit autoupdate
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-json
- id: check-yaml
- id: check-merge-conflict
- id: debug-statements
- id: check-added-large-files
- id: no-commit-to-branch
args: [--branch, master, --branch, main]
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
args: [--line-length, "120"]
- id: black-jupyter
files: '.*\.ipynb'
- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
hooks:
- id: blacken-docs
additional_dependencies:
- black==22.12.0
- repo: https://github.com/ssciwr/clang-format-hook
rev: v15.0.6
hooks:
- id: clang-format
args: [-i]
# Exclude protobuff files
exclude: '^(.*pb\.h)|(.*pb\.cc)$'
- repo: local
hooks:
- id: copyright-header-check
name: Copyright header check
description: Ensures that files have the proper copyright line at the top
entry: python3 -m examples_utils test_copyright --amend --exclude_json utils/examples_tests/copyright_header_test_exclude.json
pass_filenames: false
language: python
additional_dependencies:
- "git+https://github.com/graphcore/examples-utils@f8673d362fdc7dc77e1fee5f77cbcd81dd9e4a2e"
- id: trademark-linter
name: Trademark linter
description: Ensures that files have the proper trademark line.
entry: python3 -m utils.linters.trademark.trademark
language: python
- id: notebook-cleaner
name: Notebook cleaner
description: Removes metadata from Jupyter notebook cells to keep upstream clean.
entry: python3 -m utils.linters.notebook_cleaner.notebook_cleaner
language: python
additional_dependencies:
- nbconvert
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell