Use ct to lint charts (#9)

* Use ct to lint charts

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint all

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Do not raise for trailing spaces

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* pass config file

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Wrong flag name

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Lint

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Add validate-maintainers: false to lint conf

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* same

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* revert

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

* Only run for changed files

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>

Signed-off-by: Mauro Morales <mauro.morales@spectrocloud.com>
This commit is contained in:
Mauro Morales 2023-01-06 10:06:23 +01:00 committed by GitHub
parent 611e059eba
commit e270e801e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 82 additions and 9 deletions

35
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Lint and Test Charts
on: pull_request
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.10.0
- uses: actions/setup-python@v4
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.3.1
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --lint-conf=lintconf.yaml --validate-maintainers=false --target-branch ${{ github.event.repository.default_branch }}

View File

@ -9,4 +9,4 @@ maintainers:
email: mudler@kairos.io
version: 0.0.1
appVersion: "v0.0.1"
appVersion: "v0.0.1"

View File

@ -1,4 +1,3 @@
# Settings for the chart.
# nameOverride Replaces the release name of the chart in Chart.yaml file when
@ -42,4 +41,4 @@ resources:
memory: 50Mi
requests:
cpu: 250m
memory: 50Mi
memory: 50Mi

View File

@ -1,4 +1,3 @@
# Settings for entangle.
# nameOverride Replaces the release name of the chart in Chart.yaml file when
@ -47,4 +46,4 @@ resources:
memory: 50Mi
requests:
cpu: 250m
memory: 50Mi
memory: 50Mi

View File

@ -1,4 +1,3 @@
# Settings for entangle.
# nameOverride Replaces the release name of the chart in Chart.yaml file when

View File

@ -1,4 +1,3 @@
# Settings for the chart.
# nameOverride Replaces the release name of the chart in Chart.yaml file when
@ -58,4 +57,4 @@ resources:
memory: 50Mi
requests:
cpu: 250m
memory: 50Mi
memory: 50Mi

View File

@ -1,4 +1,3 @@
# Settings for the chart.
# nameOverride Replaces the release name of the chart in Chart.yaml file when

1
ct.yaml Normal file
View File

@ -0,0 +1 @@
validate-maintainers: false

42
lintconf.yaml Normal file
View File

@ -0,0 +1,42 @@
---
rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 0
min-spaces-after: 1
max-spaces-after: 1
comments:
require-starting-space: true
min-spaces-from-content: 2
document-end: disable
document-start: disable # No --- to start a file
empty-lines:
max: 2
max-start: 0
max-end: 0
hyphens:
max-spaces-after: 1
indentation:
spaces: consistent
indent-sequences: whatever # - list indentation will handle both indentation and without
check-multi-line-strings: false
key-duplicates: enable
line-length: disable # Lines can be any length
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: disable
truthy:
level: warning