-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
70 lines (63 loc) · 2.08 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
70 lines (63 loc) · 2.08 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Mirrors what CI enforces, so a push does not have to be the thing that tells
# you. Install with:
#
# pre-commit install
#
# Everything here runs locally; nothing reaches out to a network except the
# hook repositories on first install.
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-yaml
# The workflow files use GitHub's expression syntax, which is valid YAML
# but confuses the parser's multi-document handling in places.
args: [--allow-multiple-documents]
- id: check-json
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
args: [--fix=lf]
# A secret in a commit is a secret in the history for good.
- id: detect-private-key
- repo: local
hooks:
- id: gofmt
name: gofmt
entry: gofmt -l -w
language: system
types: [go]
- id: go-vet
name: go vet
entry: go vet ./...
language: system
types: [go]
pass_filenames: false
- id: go-test
name: go test
entry: go test ./...
language: system
types: [go]
pass_filenames: false
- id: tsc
name: tsc --noEmit
entry: bash -c 'cd web && npx tsc --noEmit'
language: system
files: ^web/src/.*\.(ts|tsx)$
pass_filenames: false
# The add-on's run script is the only shell in the repository, and it is
# what turns Home Assistant's options into mqttview's configuration.
- id: shellcheck
name: shellcheck the add-on run script
entry: shellcheck
language: system
files: ^addon/.*\.sh$
# A malformed add-on manifest is only discovered when somebody tries to
# install it, which is the worst place to find out.
- id: addon-manifest
name: the add-on manifest parses
entry: python3 -c "import sys,yaml;[yaml.safe_load(open(p)) for p in sys.argv[1:]]"
language: system
files: ^addon/.*\.yaml$