-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
55 lines (55 loc) · 1.96 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_stages: [ commit, push ]
repos:
# pre-commit formatting hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0 # Replace by any tag/version:
hooks:
- id: trailing-whitespace
- id: check-case-conflict
- id: end-of-file-fixer
- id: check-yaml
args: ["--unsafe"]
- id: check-added-large-files
args: [ '--maxkb=1024' ]
- id: mixed-line-ending
- id: fix-encoding-pragma
- id: debug-statements
- id: check-merge-conflict
- id: check-symlinks
- id: destroyed-symlinks
# - id: no-commit-to-branch # personal project - just do main directly for now
- id: fix-encoding-pragma
- id: name-tests-test
args: [ "--pytest-test-first" ]
- id: check-builtin-literals
- id: check-ast
# I decided that it is probably better to just leave the output so others can see it easily
# ensure notebook is clean before committed
# - repo: https://github.com/mudiarto/nbhooks.git
# rev: 1.5.0 # Use `pre-commit autoupdate --bleeding-edge` to set to most recent version
# hooks:
# - id: nb-ensure-clean
# args: [--meta, "editable|slideshow|tags", --fix] # keep output, errored out instead of auto clean
# clean and simplify jupyter notebook
# - repo: https://github.com/fastai/nbdev
# rev: 2.3.13
# hooks:
# # - id: nbdev_clean
# # - id: nbdev_export - no library needed
# gitleaks secret scanning
# - repo: https://github.com/zricethezav/gitleaks
# rev: v8.18.2 # Replace by any tag/version: https://github.com/zricethezav/gitleaks/releases
# hooks:
# - id: gitleaks-docker
# ruff formatter
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.1
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format