-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-hooks.yaml
More file actions
64 lines (57 loc) · 1.84 KB
/
.pre-commit-hooks.yaml
File metadata and controls
64 lines (57 loc) · 1.84 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
# keep-sorted start newline_separated=yes
- id: check-bash-shebang
name: Check bash scripts use portable shebang
description: Ensure bash scripts use '#!/usr/bin/env bash' instead of '#!/bin/bash'
language: script
entry: scripts/check_bash_shebang.sh
types_or:
- bash
- shell
- id: check-blank-first-line
name: Ensure first line is not blank
description: Ensure text files do not have a blank first line
language: script
entry: scripts/check_blank_first_line.sh --fix
types:
- text
- id: check-yaml-language-server
name: Check YAML files have yaml-language-server directive
description: Check that YAML files include a yaml-language-server schema directive
language: script
entry: scripts/check_yaml_language_server.sh
types:
- yaml
- id: check-yamlschema-local
name: Check JSON schemas of YAML files are local
description: Prevent YAML files from using remote schema references
language: pygrep
entry: '# yaml-language-server: \$schema=http'
types:
- yaml
- id: forbid-colon-filenames
name: Forbid colons in filenames
description: "Error: filenames containing ':' are not allowed."
entry: "Filenames must not contain a colon (:) in their name."
language: fail
files: ".*:.*" # match any path containing a colon
- id: just-format
alias: format-justfiles
name: Format Justfiles
entry: scripts/just_fmt.sh
language: script
files: '\.?[jJ]ustfile$'
- id: pint
name: Validate Prometheus rules with pint
entry: pint --offline lint
language: golang
additional_dependencies:
- github.com/cloudflare/pint/cmd/pint@v0.73.7
types:
- yaml
- id: sort-codeowners-sections
name: Sort CODEOWNERS sections
description: Sort [section] blocks alphabetically in CODEOWNERS-style files
language: script
entry: scripts/sort_codeowners_sections.sh --fix
files: 'OWNERS$'
# keep-sorted end