Skip to content

Commit ac1b1a4

Browse files
committed
🧪 Integrate yamllint into the project
The initial config does not change many defaults and mostly relies on the upstream config. The only changes are to the sequence style, quoting and allowed truthy values that accomodate for GHA.
1 parent 8bedb53 commit ac1b1a4

12 files changed

+538
-360
lines changed
Lines changed: 139 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,142 @@
1-
schemaVersion: '2.0.0'
1+
---
2+
3+
schemaVersion: 2.0.0
4+
25
commandTests:
3-
- name: "git"
4-
command: "git"
5-
args: ["--version"]
6-
expectedOutput: ["^git version 2\\.[0-9]+\\.[0-9]+\\n$"]
7-
8-
- name: "pre-commit"
9-
command: "pre-commit"
10-
args: ["-V"]
11-
expectedOutput: ["^pre-commit ([0-9]+\\.){2}[0-9]+\\n$"]
12-
13-
- name: "gcc"
14-
command: "gcc"
15-
args: ["--version"]
16-
expectedOutput: ["^gcc \\(Alpine 12\\."]
17-
18-
- name: "checkov"
19-
command: "checkov"
20-
args: ["--version"]
21-
expectedOutput: ["^([0-9]+\\.){2}[0-9]+\\n$"]
22-
23-
- name: "infracost"
24-
command: "infracost"
25-
args: ["--version"]
26-
expectedOutput: ["^Infracost v([0-9]+\\.){2}[0-9]+"]
27-
28-
- name: "opentofu"
29-
command: "tofu"
30-
args: ["-version"]
31-
expectedOutput: ["^OpenTofu v([0-9]+\\.){2}[0-9]+\\n"]
32-
33-
- name: "terraform"
34-
command: "terraform"
35-
args: ["-version"]
36-
expectedOutput: ["^Terraform v([0-9]+\\.){2}[0-9]+\\n"]
37-
38-
- name: "terraform-docs"
39-
command: "terraform-docs"
40-
args: ["--version"]
41-
expectedOutput: ["^terraform-docs version v([0-9]+\\.){2}[0-9]+ [a-z0-9]+"]
42-
43-
- name: "terragrunt"
44-
command: "terragrunt"
45-
args: ["--version"]
46-
expectedOutput: ["^terragrunt version v([0-9]+\\.){2}[0-9]+\\n$"]
47-
48-
- name: "terrascan"
49-
command: "terrascan"
50-
args: [ "version" ]
51-
expectedOutput: [ "^version: v([0-9]+\\.){2}[0-9]+\\n$" ]
52-
53-
- name: "tflint"
54-
command: "tflint"
55-
args: [ "--version" ]
56-
expectedOutput: [ "TFLint version ([0-9]+\\.){2}[0-9]+\\n" ]
57-
58-
- name: "tfsec"
59-
command: "tfsec"
60-
args: [ "--version" ]
61-
expectedOutput: [ "([0-9]+\\.){2}[0-9]+\\n$" ]
62-
63-
- name: "trivy"
64-
command: "trivy"
65-
args: [ "--version" ]
66-
expectedOutput: [ "Version: ([0-9]+\\.){2}[0-9]+\\n" ]
67-
68-
- name: "tfupdate"
69-
command: "tfupdate"
70-
args: [ "--version" ]
71-
expectedOutput: [ "([0-9]+\\.){2}[0-9]+\\n$" ]
72-
73-
- name: "hcledit"
74-
command: "hcledit"
75-
args: [ "version" ]
76-
expectedOutput: [ "([0-9]+\\.){2}[0-9]+\\n$" ]
77-
78-
- name: "entrypoint.sh"
79-
envVars:
80-
- key: "USERID"
81-
value: "1000:1000"
82-
command: "/entrypoint.sh"
83-
args: [ "-V" ]
84-
expectedError: ["^ERROR: uid:gid 1000:1000 lacks permissions to //\\n$"]
85-
exitCode: 1
86-
87-
- name: "su-exec"
88-
command: "su-exec"
89-
expectedOutput: ["^Usage: su-exec user-spec command \\[args\\]\\n$"]
90-
91-
- name: "ssh"
92-
command: "ssh"
93-
args: [ "-V" ]
94-
expectedError: ["^OpenSSH_9\\.[0-9]+"]
6+
- name: git
7+
command: git
8+
args:
9+
- --version
10+
expectedOutput:
11+
- ^git version 2\.[0-9]+\.[0-9]+\n$
12+
13+
- name: pre-commit
14+
command: pre-commit
15+
args:
16+
- -V
17+
expectedOutput:
18+
- ^pre-commit ([0-9]+\.){2}[0-9]+\n$
19+
20+
- name: gcc
21+
command: gcc
22+
args:
23+
- --version
24+
expectedOutput:
25+
- ^gcc \(Alpine 12\.
26+
27+
- name: checkov
28+
command: checkov
29+
args:
30+
- --version
31+
expectedOutput:
32+
- ^([0-9]+\.){2}[0-9]+\n$
33+
34+
- name: infracost
35+
command: infracost
36+
args:
37+
- --version
38+
expectedOutput:
39+
- ^Infracost v([0-9]+\.){2}[0-9]+
40+
41+
- name: opentofu
42+
command: tofu
43+
args:
44+
- --version
45+
expectedOutput:
46+
- ^OpenTofu v([0-9]+\.){2}[0-9]+\n
47+
48+
- name: terraform
49+
command: terraform
50+
args:
51+
- --version
52+
expectedOutput:
53+
- ^Terraform v([0-9]+\.){2}[0-9]+\n
54+
55+
- name: terraform-docs
56+
command: terraform-docs
57+
args:
58+
- --version
59+
expectedOutput:
60+
- ^terraform-docs version v([0-9]+\.){2}[0-9]+ [a-z0-9]+
61+
62+
- name: terragrunt
63+
command: terragrunt
64+
args:
65+
- --version
66+
expectedOutput:
67+
- ^terragrunt version v([0-9]+\.){2}[0-9]+\n$
68+
69+
- name: terrascan
70+
command: terrascan
71+
args:
72+
- --version
73+
expectedOutput:
74+
- ^version: v([0-9]+\.){2}[0-9]+\n$
75+
76+
- name: tflint
77+
command: tflint
78+
args:
79+
- --version
80+
expectedOutput:
81+
- TFLint version ([0-9]+\.){2}[0-9]+\n
82+
83+
- name: tfsec
84+
command: tfsec
85+
args:
86+
- --version
87+
expectedOutput:
88+
- ([0-9]+\.){2}[0-9]+\n$
89+
90+
- name: trivy
91+
command: trivy
92+
args:
93+
- --version
94+
expectedOutput:
95+
- Version: ([0-9]+\.){2}[0-9]+\n
96+
97+
- name: tfupdate
98+
command: tfupdate
99+
args:
100+
- --version
101+
expectedOutput:
102+
- ([0-9]+\.){2}[0-9]+\n$
103+
104+
- name: hcledit
105+
command: hcledit
106+
args:
107+
- --version
108+
expectedOutput:
109+
- ([0-9]+\.){2}[0-9]+\n$
110+
111+
- name: entrypoint.sh
112+
envVars:
113+
- key: USERID
114+
value: 1000:1000
115+
command: /entrypoint.sh
116+
args:
117+
- -V
118+
expectedError:
119+
- >-
120+
^ERROR: uid:gid 1000:1000 lacks permissions to //\n$
121+
exitCode: 1
122+
123+
- name: su-exec
124+
command: su-exec
125+
expectedOutput:
126+
- ^Usage: su-exec user-spec command \[args\]\n$
127+
128+
- name: ssh
129+
command: ssh
130+
args:
131+
- -V
132+
expectedError:
133+
- ^OpenSSH_9\.[0-9]+
95134

96135
fileExistenceTests:
97-
- name: 'terrascan init'
98-
path: '/root/.terrascan/pkg/policies/opa/rego/github/github_repository/privateRepoEnabled.rego'
99-
shouldExist: true
100-
uid: 0
101-
gid: 0
136+
- name: terrascan init
137+
# yamllint disable-line rule:line-length
138+
path: >-
139+
/root/.terrascan/pkg/policies/opa/rego/github/github_repository/privateRepoEnabled.rego
140+
shouldExist: true
141+
uid: 0
142+
gid: 0

.github/.dive-ci.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
---
2+
13
rules:
24
# If the efficiency is measured below X%, mark as failed.
35
# Expressed as a ratio between 0-1.
46
lowestEfficiency: 0.981
57

6-
# If the amount of wasted space is at least X or larger than X, mark as failed.
8+
# If the amount of wasted space is at least X or larger than X, mark
9+
# as failed.
710
# Expressed in B, KB, MB, and GB.
811
highestWastedBytes: 32MB
912

10-
# If the amount of wasted space makes up for X% or more of the image, mark as failed.
13+
# If the amount of wasted space makes up for X% or more of the image,
14+
# mark as failed.
1115
# Note: the base image layer is NOT included in the total image size.
1216
# Expressed as a ratio between 0-1; fails if the threshold is met or crossed.
1317
highestUserWastedPercent: 0.036

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
---
2+
13
github: [antonbabenko]
24
custom: https://www.paypal.me/antonbabenko

0 commit comments

Comments
 (0)