forked from scverse/ecosystem-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
52 lines (52 loc) · 1.42 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
fail_fast: false
default_language_version:
python: python3
default_stages:
- commit
- push
minimum_pre_commit_version: 2.16.0
repos:
# all files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: detect-private-key
- id: check-ast
- id: end-of-file-fixer
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
- id: check-case-conflict
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
# package metadata
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.1
hooks:
- id: check-jsonschema
files: "schema.json"
args: ["--check-metaschema"]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.1
hooks:
- id: check-jsonschema
files: "packages/.*/meta.yaml"
args: ["--schemafile", "schema.json"]
- repo: local
hooks:
- id: forbid-to-commit
name: Check files in `packages` directory
entry: |
Only files named `meta.yaml` are permitted in the packages directory
language: fail
files: "^packages/.*$"
exclude: "^packages/.*/meta.yaml$"
# template repo registry
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.5
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format