Skip to content

Commit

Permalink
feat: add helm lint (#2386)
Browse files Browse the repository at this point in the history
* feat: add helm linter

* fix: add cspell word for subcharts

* fix: remove trailing space

* fix: add active_only_if_file_found option for helm linter

* fix : add helm logoo for linter banner

* feat: use cli_version_arg_name for helm linter (autoupdate version)

and fix help command

* Update .cspell.json

---------

Co-authored-by: Nicolas Vuillamy <nicolas.vuillamy@gmail.com>
  • Loading branch information
ThomasSanson and nvuillam authored Mar 11, 2023
1 parent 9d35c0a commit 031c116
Show file tree
Hide file tree
Showing 45 changed files with 452 additions and 0 deletions.
103 changes: 103 additions & 0 deletions .automation/generated/linter-helps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .automation/generated/linter-links-previews.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@
"image": "https://avatars1.githubusercontent.com/u/34047791?s=400&v=4",
"title": "hadolint/hadolint"
},
"helm": {
"description": "Helm - The Kubernetes Package Manager.",
"image": "https://helm.sh/img/og-image.png",
"title": "Helm Lint"
},
"htmlhint": {
"description": "\u2699\ufe0f The static code analysis tool you need for your HTML - htmlhint/HTMLHint",
"image": "https://avatars0.githubusercontent.com/u/42865284?s=400&v=4",
Expand Down
1 change: 1 addition & 0 deletions .automation/generated/linter-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"goodcheck": "3.1.0",
"graphql-schema-linter": "3.0.1",
"hadolint": "2.12.0",
"helm": "3.10.2",
"htmlhint": "1.1.4",
"isort": "5.12.0",
"jscpd": "3.5.3",
Expand Down
19 changes: 19 additions & 0 deletions .automation/test/kubernetes_helm/bad/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v2
name: hello-world
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
24 changes: 24 additions & 0 deletions .automation/test/kubernetes_helm/good/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: hello-world
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
1 change: 1 addition & 0 deletions .github/workflows/deploy-BETA-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
"kotlin_ktlint",
"kubernetes_kubeval",
"kubernetes_kubeconform",
"kubernetes_helm",
"latex_chktex",
"lua_luacheck",
"makefile_checkmake",
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-DEV-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ jobs:
"kotlin_ktlint",
"kubernetes_kubeval",
"kubernetes_kubeconform",
"kubernetes_helm",
"latex_chktex",
"lua_luacheck",
"makefile_checkmake",
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-RELEASE-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
"kotlin_ktlint",
"kubernetes_kubeval",
"kubernetes_kubeconform",
"kubernetes_helm",
"latex_chktex",
"lua_luacheck",
"makefile_checkmake",
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,5 @@ megalinter-reports/
github_conf/

Pipfile

run_local_linter.sh
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-linter.yml file, or with `oxsecurity/megalinter:beta` docker image

- Add helm lint, by @ThomasSanson in https://github.com/oxsecurity/megalinter/pull/2386

- Linter versions upgrades
- [ansible-lint](https://ansible-lint.readthedocs.io/) from 6.14.1 to **6.14.2** on 2023-03-11
- [checkstyle](https://checkstyle.sourceforge.io) from 10.8.0 to **10.8.1** on 2023-03-11
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ RUN apk add --update --no-cache \
npm \
yarn \
go \
helm \
openssl \
readline-dev \
g++ \
Expand Down
1 change: 1 addition & 0 deletions docs/standalone-linters.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
| KOTLIN_KTLINT | oxsecurity/megalinter-only-kotlin_ktlint:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-kotlin_ktlint/beta) |
| KUBERNETES_KUBEVAL | oxsecurity/megalinter-only-kubernetes_kubeval:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-kubernetes_kubeval/beta) |
| KUBERNETES_KUBECONFORM | oxsecurity/megalinter-only-kubernetes_kubeconform:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-kubernetes_kubeconform/beta) |
| KUBERNETES_HELM | oxsecurity/megalinter-only-kubernetes_helm:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-kubernetes_helm/beta) |
| LATEX_CHKTEX | oxsecurity/megalinter-only-latex_chktex:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-latex_chktex/beta) |
| LUA_LUACHECK | oxsecurity/megalinter-only-lua_luacheck:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-lua_luacheck/beta) |
| MAKEFILE_CHECKMAKE | oxsecurity/megalinter-only-makefile_checkmake:beta | ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/oxsecurity/megalinter-only-makefile_checkmake/beta) |
Expand Down
1 change: 1 addition & 0 deletions flavors/cupcake/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ RUN apk add --update --no-cache \
npm \
yarn \
go \
helm \
libc-dev \
libxml2-dev \
libxml2-utils \
Expand Down
1 change: 1 addition & 0 deletions flavors/cupcake/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"KUBERNETES_HELM",
"MAKEFILE_CHECKMAKE",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
Expand Down
1 change: 1 addition & 0 deletions flavors/documentation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN apk add --update --no-cache \
nodejs \
npm \
yarn \
helm \
libc-dev \
libxml2-dev \
libxml2-utils \
Expand Down
1 change: 1 addition & 0 deletions flavors/documentation/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"KUBERNETES_HELM",
"MAKEFILE_CHECKMAKE",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
Expand Down
1 change: 1 addition & 0 deletions flavors/dotnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ RUN apk add --update --no-cache \
nodejs \
npm \
yarn \
helm \
libc-dev \
libxml2-dev \
libxml2-utils \
Expand Down
1 change: 1 addition & 0 deletions flavors/dotnet/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"KUBERNETES_HELM",
"MAKEFILE_CHECKMAKE",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
Expand Down
1 change: 1 addition & 0 deletions flavors/go/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ RUN apk add --update --no-cache \
npm \
yarn \
go \
helm \
libc-dev \
libxml2-dev \
libxml2-utils \
Expand Down
1 change: 1 addition & 0 deletions flavors/go/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"KUBERNETES_HELM",
"MAKEFILE_CHECKMAKE",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
Expand Down
1 change: 1 addition & 0 deletions flavors/java/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN apk add --update --no-cache \
nodejs \
npm \
yarn \
helm \
libc-dev \
libxml2-dev \
libxml2-utils \
Expand Down
1 change: 1 addition & 0 deletions flavors/java/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"KUBERNETES_HELM",
"MAKEFILE_CHECKMAKE",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
Expand Down
1 change: 1 addition & 0 deletions flavors/javascript/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ RUN apk add --update --no-cache \
nodejs \
npm \
yarn \
helm \
libc-dev \
libxml2-dev \
libxml2-utils \
Expand Down
1 change: 1 addition & 0 deletions flavors/javascript/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"KUBERNETES_HELM",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
"MARKDOWN_MARKDOWN_TABLE_FORMATTER",
Expand Down
1 change: 1 addition & 0 deletions flavors/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ RUN apk add --update --no-cache \
nodejs \
npm \
yarn \
helm \
libc-dev \
libxml2-dev \
libxml2-utils \
Expand Down
1 change: 1 addition & 0 deletions flavors/php/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"KUBERNETES_HELM",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
"MARKDOWN_MARKDOWN_TABLE_FORMATTER",
Expand Down
1 change: 1 addition & 0 deletions flavors/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN apk add --update --no-cache \
nodejs \
npm \
yarn \
helm \
libc-dev \
libxml2-dev \
libxml2-utils \
Expand Down
1 change: 1 addition & 0 deletions flavors/python/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"KUBERNETES_HELM",
"MAKEFILE_CHECKMAKE",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
Expand Down
1 change: 1 addition & 0 deletions flavors/ruby/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ RUN apk add --update --no-cache \
nodejs \
npm \
yarn \
helm \
libc-dev \
libxml2-dev \
libxml2-utils \
Expand Down
1 change: 1 addition & 0 deletions flavors/ruby/flavor.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"KOTLIN_KTLINT",
"KUBERNETES_KUBEVAL",
"KUBERNETES_KUBECONFORM",
"KUBERNETES_HELM",
"MARKDOWN_MARKDOWNLINT",
"MARKDOWN_MARKDOWN_LINK_CHECK",
"MARKDOWN_MARKDOWN_TABLE_FORMATTER",
Expand Down
1 change: 1 addition & 0 deletions flavors/rust/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ RUN apk add --update --no-cache \
nodejs \
npm \
yarn \
helm \
libc-dev \
libxml2-dev \
libxml2-utils \
Expand Down
Loading

0 comments on commit 031c116

Please sign in to comment.