-
Notifications
You must be signed in to change notification settings - Fork 2
/
lefthook.yml
118 lines (112 loc) · 4.19 KB
/
lefthook.yml
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
# EXAMPLE USAGE
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/full_guide.md
#
# skip_output:
# - meta
# - success
# - summary
# Install go get github.com/evilmartians/lefthook
# This will run the key security checks that will have redacted secrets on output
ci-checks:
commands:
pre-push:
commands:
# squealer:
# tags: security
# name: squealer
# run: squealer --config-file squealer.yml # run: bundle audit
# github.com/owenrumney/squealer/cmd/squealer@latest
pre-commit:
# parallel: false
tags: lint
commands:
# squealer:
# name: squealer go
# run: squealer --config-file squealer.yml # run: bundle audit
gitleaks:
tags: security gotool
name: gitleaks-scan
# run: docker run -v ${PWD}:/repo zricethezav/gitleaks:latest --path="/repo" --pretty -v
run: |
gitleaks --unstaged --config-path=./.gitleaks.toml -vq | gojq
# not windows compatible yet
markdownlint-and-build:
piped: true
tags: docker
commands:
markdownlint:
name: markdownlint
# files: git diff-index --name-only HEAD #git ls-files **/*.md -m #git diff-index --name-only HEAD #git ls-files **/*/*.md -m
glob: '*.md'
run: |
echo "⚡ markdownlint on: {files}"
for file in {files}
do
echo "🔨 markdownlint: $file"
docker run --rm -v ${PWD}:/workdir --entrypoint="markdownlint-cli2-fix" davidanson/markdownlint-cli2:latest "$file"
done
hugo:
tags: build
name: hugo-build
run: MAGEFILE_HASHFAST=1 mage hugo:build
#yarn run markdownlint-cli2-fix "{files}"
# markdownlint-cli2 "{files}"
#"**/*.md" "#node_modules"
# docker run --rm -v ${PWD}:/workdir --entrypoint="markdownlint-cli2-fix" davidanson/markdownlint-cli2:latest "**/*.md" "#node_modules"
# yamllint: go install github.com/gechr/yamlfmt
yamlfmt:
tags: yaml
# files: git diff-index --name-only HEAD #git ls-files **/*/*.md -m
glob: '*.yaml|*.yml'
run: yamlfmt {staged_files}
# markdownlint:
# tags: docker
# name: markdownlint
# files: git diff-index --name-only HEAD #git ls-files **/*/*.md -m
# glob: '*.md'
# run: |
# echo "⚡ markdownlint on: {files}"
# docker run -i --rm -v ${PWD}:/markdown 06kellyjac/markdownlint-cli:latest --fix {files}
# # Mount Config: -v ${PWD}/.markdownlint.yaml:/markdown/.markdownlint.yaml
# Install with task init; Manually install with npm install -g imageoptim-cli
imageoptim:
tags: image npm
name: imageoptim
# files: git diff-index --name-only HEAD
glob: '*.png'
run: |
echo "⚡ imageoptim on: {staged_files}"
yarn imageoptim {staged_files}
# --imagealpha
#DIFF: git diff-index --name-only HEAD
# git ls-files *.png --modified # only run on newly staged files
# {files}
# shellcheck:
# tags: gotool
# name: shellcheck
# files: git ls-files -m
# glob: '*.sh'
# run: docker run --rm -v ${PWD}:/mnt koalaman/shellcheck:stable --format=json {files}
# yamllint:
# tags: formatting lint
# name: yamllint
# glob: '*.yml|*.yaml'
# run: docker run --rm -v ${PWD}:/yaml sdesbure/yamllint:latest yamllint --format parsable --strict --config-file .yamllint.yaml {files}
# conventionalcommits:
# tags: commit documentation
# name: message uses conventional commit format
# # run: commitsar
# run: docker run --rm --name="commitsar" -w /src -v ${PWD}:/src aevea/commitsar
# conventionalcommits:
# tags: commit documentation
# name: message uses conventional commit format
# # run: commitsar
# run: docker run --rm peakfijn/commitlint -v ${PWD}:/app/ commitlint #{--volume ${PWD}/.git:/app/.git --volume ${PWD}/.commitlintrc:/app/.commitlintrc
# docker run --rm --name="commitsar2" -w /src -v ${PWD}:/src commitsar/commitsar:latest
# docker pull commitsar/commitsar:latest
# revive:
# tags: gotool
# name: revive
# run: revive -config revive.toml --formatter friendly