-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-hooks.yaml
136 lines (126 loc) · 3.39 KB
/
.pre-commit-hooks.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
- id: fixShebangExecutionBit
name: fixShebangExecutionBit
description: |
Find all files containing a shebang and
mark them as executable if not yet
language: script
entry: bin/findShebangFiles
args: [chmod, +x]
pass_filenames: false
types: ["file", "shell", "text"]
always_run: true
stages: [pre-commit, manual]
- &FRAMEWORK_LINT
id: frameworkLint
name: Bash Framework Lint
description: |
Check if your files uses the right syntax
for using bash-tools-framework
language: script
entry: bin/frameworkLint
args:
[--expected-warnings-count, "0", --format, plain, --theme, default-force]
pass_filenames: false
types: ["executable", "file", "shell", "text"]
always_run: false
stages: [pre-commit]
- <<: *FRAMEWORK_LINT
id: frameworkLintGithubAction
name: Bash Framework Lint for Github Actions
args: [--expected-warnings-count, "0", --format, checkstyle, --theme, noColor]
log_file: logs/frameworkLint.xml
stages: [manual]
- id: awkLint
name: awk Lint
description: Lint awk files using awk.
language: script
entry: bin/awkLint
args: []
log_file: logs/awkLint.xml
pass_filenames: false
files: \.awk$
always_run: false
stages: [pre-commit, manual]
- &SHELLCHECK_LINT
id: shellcheckLint
name: shellcheck Lint
description: |
Lint bash files using shellcheck.
Installing last version automatically
language: script
entry: bin/shellcheckLint
args: [-f, tty, --xargs]
pass_filenames: true
files: \.sh$
types: ["executable", "file", "shell", "text"]
always_run: false
stages: [pre-commit]
- <<: *SHELLCHECK_LINT
id: shellcheckLintGithubAction
name: shellcheck Linter for Github Actions
args: [-f, checkstyle, --xargs]
log_file: logs/shellcheckLint.xml
stages: [manual]
- id: runUnitTests
name: Run unit tests
description: run unit test using bats in docker isolated environment
language: script
entry: preCommitTest.sh
args: ["scrasnups/build:bash-tools-ubuntu-5.3", -r, src, -j, "30"]
pass_filenames: false
always_run: true
require_serial: true
stages: [pre-commit]
- id: plantuml
name: Plantuml Converter
description: Convert plantuml files to images
language: script
entry: bin/plantuml
args: [--ci, --same-dir, -f, png, -f, svg]
pass_filenames: true
types: ["file", "non-executable", "plantuml", "text"]
always_run: false
stages: [pre-commit, manual]
- id: megalinterCheckVersion
name: Megalinter Check Version
description: Megalinter Check if new version is available
language: script
entry: bin/megalinter
args:
[--image, "oxsecurity/megalinter-terraform:v8", --check-megalinter-version]
pass_filenames: false
always_run: true
stages: [pre-commit, manual]
- &MEGALINTER
id: megalinter
name: Megalinter
description: use megalinter to check your project
language: script
entry: bin/megalinter
args:
[
--image,
"oxsecurity/megalinter-terraform:v8",
--config-file,
".mega-linter-light.yml",
--fix,
]
pass_filenames: false
require_serial: true
always_run: true
verbose: true
stages: [pre-commit]
# manual stage used to select github action with megalinter full config
- <<: *MEGALINTER
id: megalinterGithubAction
name: Megalinter for Github Actions
args:
[
--image,
"oxsecurity/megalinter-terraform:v8",
--config-file,
".mega-linter-githubAction.yml",
--fix,
]
stages: [manual]