-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
73 lines (67 loc) · 2.49 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
70
71
72
73
repos:
- repo: local
hooks:
# go-fmt ~ Enforces Go standard formatting (whitespace, indentation, et cetera)
- id: go-fmt
name: go-fmt
description: "Enforces Go standard formatting (whitespace, indentation, et cetera)."
entry: ./datastore/ci/go/go-fmt.sh
language: script
pass_filenames: false
# # go-vet ~ Finds subtle issues in Go where your code may not work as intended
# - id: go-vet
# name: go-vet
# description: "Finds subtle issues in Go where your code may not work as intended."
# entry: ./ci/go/go-vet.sh
# language: script
# pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# Formatting
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
- id: pretty-format-json
args: ["--autofix", "--indent=4", "--no-ensure-ascii", "--no-sort-keys"] # Formats and sorts your JSON files.
- id: trailing-whitespace # Trims trailing whitespace.
# Checks
- id: check-json # Attempts to load all json files to verify syntax.
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: check-shebang-scripts-are-executable # Checks that scripts with shebangs are executable.
- id: check-yaml
# only checks syntax not load the yaml:
# https://stackoverflow.com/questions/59413979/how-exclude-ref-tag-from-check-yaml-git-hook
args: ["--unsafe"] # Parse the yaml files for syntax.
# reorder-python-imports ~ sort python imports
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.12.0
hooks:
- id: reorder-python-imports
# black ~ Formats Python code
- repo: https://github.com/psf/black
rev: 23.10.0
hooks:
- id: black
args: ["--line-length=120"]
# flake8 ~ Enforces the Python PEP8 style guide
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
args:
[
"--ignore=W503",
"--max-line-length=120",
]
# hadolint ~ Docker linter
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint-docker
args: [
"--ignore=DL3008", # Pin versions in apt get install.
]
# ShellCheck ~ Gives warnings and suggestions for bash/sh shell scripts
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck