-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path.pre-commit-config.yaml
66 lines (62 loc) · 2.52 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
exclude: "^$"
fail_fast: false
repos:
- repo: /~https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
args: ["--maxkb=1024"]
# forbid files which have a UTF-8 byte-order marker
- id: fix-byte-order-marker
# Check for files that would conflict in case-insensitive filesystems
- id: check-case-conflict
# This hook checks json files for parseable syntax.
- id: check-json
# Check for files that contain merge conflict strings.
- id: check-merge-conflict
# Checks for symlinks which do not point to anything.
- id: check-symlinks
# This hook checks toml files for parseable syntax.
- id: check-toml
# Ensures that links to vcs websites are permalinks.
- id: check-vcs-permalinks
# This hook checks xml files for parseable syntax.
- id: check-xml
# This hook checks yaml files for parseable syntax.
- id: check-yaml
# Detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to.
- id: destroyed-symlinks
# Detects the presence of private keys
- id: detect-private-key
exclude: TIPS.md
# Ensures that a file is either empty, or ends with one newline.
- id: end-of-file-fixer
exclude: README.md
# Replaces or checks mixed line ending
- id: mixed-line-ending
args: ["--fix=lf"]
description: Forces to replace line ending by the UNIX 'lf' character.
# Optional. Conflicts with prettier.
# - id: pretty-format-json
# args: ["--autofix", "--indent", "2", "--no-sort-keys"]
# This hook trims trailing whitespace.
- id: trailing-whitespace
# Prettier is an opinionated code formatter.
# It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
- repo: /~https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1"
hooks:
- id: prettier
- repo: /~https://github.com/dnephin/pre-commit-golang
rev: v0.5.0
hooks:
# trigger automatically formats Go source code of your whole project.
- id: go-fmt
# automatically update your Go import lines (add missing and remove unreferenced imports).
- id: go-imports
# finding and warning which files does not have test cover.
- id: no-go-testing
# run linter.
- id: golangci-lint
# run go test command.
- id: go-unit-tests