forked from apple/coreai-torch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
54 lines (50 loc) · 1.55 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
54 lines (50 loc) · 1.55 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
# See https://pre-commit.com for more information
# To install: pre-commit install --hook-type pre-commit --hook-type pre-push
# To update: pre-commit autoupdate
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-merge-conflict
- id: check-case-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
args: [--fix=lf]
- id: detect-private-key
# Notebooks - strip outputs before commit
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
- id: nbstripout
# Python - Ruff (fast linter + formatter)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.8
hooks:
- id: ruff-check
types_or: [python, pyi]
args: [--fix]
- id: ruff-format
types_or: [python, pyi]
# Insert BSD-3-Clause license header into every Python source file
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
name: insert license header (python)
types_or: [python, pyi]
args:
- --license-filepath=.license-header.txt
- --comment-style=#
- id: insert-license
name: insert license header (shell)
types: [shell]
args:
- --license-filepath=.license-header.txt
- --comment-style=#
- --insert-license-after-regex=^#!.*$