-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
69 lines (61 loc) · 1.79 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
64
65
66
67
68
69
# To install hooks:
# poetry run pre-commit install
# To update hooks:
# poetry run pre-commit autoupdate
# To run hooks:
# poetry run pre-commit run --all-files --hook-stage push
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
# Check yaml files like this one and github actions if they are valid
- id: check-yaml
# Check toml files like pyproject.toml if it is valid
- id: check-toml
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
# Check for bad code
- id: python-no-eval
- id: python-no-log-warn
# Enforce type annotation instead of comment annotation
- id: python-use-type-annotations
# Autoformat yaml files
# - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
# rev: v2.11.0
# hooks:
# - id: pretty-format-yaml
# args: [--autofix, --indent, '2']
# Check github action workflow files
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.28.4
hooks:
- id: check-github-workflows
# Detect functions and variables that are never used
#- repo: https://github.com/asottile/dead
# rev: v1.4.0
# hooks:
# - id: dead
- repo: local
hooks:
# Install earthly requirements
- id: earthly-install
name: Install earthly requirements
stages: [commit]
language: system
entry: earthly +install-all --verbose true
pass_filenames: false
# Check formatting, lint, dont run tests because pre-commit should be fast
- id: earthly-pre-commit
name: Run earthly pre commmit
stages: [commit]
language: system
entry: earthly +pre-commit --verbose true
pass_filenames: false
# - id: pytest-cov
# name: pytest
# stages: [push]
# language: system
# entry: poetry run pytest --cov=. --cov-fail-under=100
# types: [python]
# pass_filenames: false