Skip to content

Commit e270e80

Browse files
authored
Use ct to lint charts (#9)
* Use ct to lint charts Signed-off-by: Mauro Morales <[email protected]> * Lint all Signed-off-by: Mauro Morales <[email protected]> * Lint Signed-off-by: Mauro Morales <[email protected]> * Do not raise for trailing spaces Signed-off-by: Mauro Morales <[email protected]> * pass config file Signed-off-by: Mauro Morales <[email protected]> * Wrong flag name Signed-off-by: Mauro Morales <[email protected]> * Lint Signed-off-by: Mauro Morales <[email protected]> * Add validate-maintainers: false to lint conf Signed-off-by: Mauro Morales <[email protected]> * same Signed-off-by: Mauro Morales <[email protected]> * revert Signed-off-by: Mauro Morales <[email protected]> * Only run for changed files Signed-off-by: Mauro Morales <[email protected]> Signed-off-by: Mauro Morales <[email protected]>
1 parent 611e059 commit e270e80

File tree

9 files changed

+82
-9
lines changed

9 files changed

+82
-9
lines changed

.github/workflows/lint.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Lint and Test Charts
2+
3+
on: pull_request
4+
5+
jobs:
6+
lint-test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Set up Helm
15+
uses: azure/setup-helm@v3
16+
with:
17+
version: v3.10.0
18+
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: '3.9'
22+
check-latest: true
23+
24+
- name: Set up chart-testing
25+
uses: helm/[email protected]
26+
27+
- name: Run chart-testing (list-changed)
28+
id: list-changed
29+
run: |
30+
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
31+
if [[ -n "$changed" ]]; then
32+
echo "::set-output name=changed::true"
33+
fi
34+
- name: Run chart-testing (lint)
35+
run: ct lint --lint-conf=lintconf.yaml --validate-maintainers=false --target-branch ${{ github.event.repository.default_branch }}

charts/cluster-api-provider-kairos/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ maintainers:
99
1010

1111
version: 0.0.1
12-
appVersion: "v0.0.1"
12+
appVersion: "v0.0.1"

charts/cluster-api-provider-kairos/values.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Settings for the chart.
32

43
# nameOverride Replaces the release name of the chart in Chart.yaml file when
@@ -42,4 +41,4 @@ resources:
4241
memory: 50Mi
4342
requests:
4443
cpu: 250m
45-
memory: 50Mi
44+
memory: 50Mi

charts/entangle-proxy/values.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Settings for entangle.
32

43
# nameOverride Replaces the release name of the chart in Chart.yaml file when
@@ -47,4 +46,4 @@ resources:
4746
memory: 50Mi
4847
requests:
4948
cpu: 250m
50-
memory: 50Mi
49+
memory: 50Mi

charts/entangle/values.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Settings for entangle.
32

43
# nameOverride Replaces the release name of the chart in Chart.yaml file when

charts/kcrypt-challenger/values.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Settings for the chart.
32

43
# nameOverride Replaces the release name of the chart in Chart.yaml file when
@@ -58,4 +57,4 @@ resources:
5857
memory: 50Mi
5958
requests:
6059
cpu: 250m
61-
memory: 50Mi
60+
memory: 50Mi

charts/osbuilder/values.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Settings for the chart.
32

43
# nameOverride Replaces the release name of the chart in Chart.yaml file when

ct.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
validate-maintainers: false

lintconf.yaml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
rules:
3+
braces:
4+
min-spaces-inside: 0
5+
max-spaces-inside: 0
6+
min-spaces-inside-empty: -1
7+
max-spaces-inside-empty: -1
8+
brackets:
9+
min-spaces-inside: 0
10+
max-spaces-inside: 0
11+
min-spaces-inside-empty: -1
12+
max-spaces-inside-empty: -1
13+
colons:
14+
max-spaces-before: 0
15+
max-spaces-after: 1
16+
commas:
17+
max-spaces-before: 0
18+
min-spaces-after: 1
19+
max-spaces-after: 1
20+
comments:
21+
require-starting-space: true
22+
min-spaces-from-content: 2
23+
document-end: disable
24+
document-start: disable # No --- to start a file
25+
empty-lines:
26+
max: 2
27+
max-start: 0
28+
max-end: 0
29+
hyphens:
30+
max-spaces-after: 1
31+
indentation:
32+
spaces: consistent
33+
indent-sequences: whatever # - list indentation will handle both indentation and without
34+
check-multi-line-strings: false
35+
key-duplicates: enable
36+
line-length: disable # Lines can be any length
37+
new-line-at-end-of-file: enable
38+
new-lines:
39+
type: unix
40+
trailing-spaces: disable
41+
truthy:
42+
level: warning

0 commit comments

Comments
 (0)