-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.pre-commit-config.yaml
94 lines (89 loc) · 2.55 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
repos:
# General checks
- repo: local
hooks:
- name: Prevent committing to main
id: no-commit-to-branch
language: system
entry: no-commit-to-branch
args: [--branch, main]
pass_filenames: false
- name: Make sure files end with a newline character
id: end-of-file-fixer
language: system
entry: end-of-file-fixer
types: [text]
- name: Remove trailing whitespace
id: trailing-whitespace-fixer
language: system
entry: trailing-whitespace-fixer
types: [text]
- name: Check for files that would conflict on case-insensitive filesystem
id: check-case-conflict
language: system
entry: check-case-conflict
- name: Check for merge conflicts
id: check-merge-conflict
language: system
entry: check-merge-conflict
- name: Check executable files have a shebang
id: check-executables-have-shebangs
language: system
entry: check-executables-have-shebangs
types: [executable]
- name: Check scripts with a shebang are executable
id: check-shebang-scripts-are-executable
language: system
entry: check-shebang-scripts-are-executable
- name: Don't allow adding large files
id: check-added-large-files
language: system
entry: check-added-large-files
# Roc
- repo: https://github.com/hasnep/pre-commit-roc
rev: v0.1.0
hooks:
- name: Lint Roc files
id: check
args: [src/main.roc]
- name: Format Roc files
id: format
# YAML
- repo: local
hooks:
- name: Format YAML files
id: yaml-format
language: system
entry: prettier --write
types: [yaml]
# Markdown
- repo: local
hooks:
- name: Format markdown files
id: markdown-format
language: system
entry: prettier --write
types: [markdown]
# GitHub Actions
- repo: local
hooks:
- name: Validate GitHub Actions workflow files
id: github-workflows-check
language: system
entry: actionlint
types: [yaml]
files: \.github/workflows/.*\.ya?ml$
- name: Check GitHub Actions are pinned
id: github-workflows-check-pinned
language: system
entry: ratchet check
types: [yaml]
files: \.github/workflows/.*\.ya?ml$
# Nix
- repo: local
hooks:
- name: Format Nix files
id: nix-format
language: system
entry: nixfmt
types: [nix]