mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-21 13:41:19 -05:00
feat: support GoReleaser (#5505)
This commit is contained in:
parent
ca2a4167b8
commit
69249882f3
9 changed files with 18 additions and 1 deletions
|
@ -14,6 +14,7 @@ FROM ghcr.io/terraform-linters/tflint:v0.50.3 as tflint
|
|||
FROM ghcr.io/yannh/kubeconform:v0.6.4 as kubeconfrm
|
||||
FROM golang:1.22.2-alpine as golang
|
||||
FROM golangci/golangci-lint:v1.57.2 as golangci-lint
|
||||
FROM goreleaser/goreleaser:v1.25.1 as goreleaser
|
||||
FROM hadolint/hadolint:v2.12.0-alpine as dockerfile-lint
|
||||
FROM hashicorp/terraform:1.7.5 as terraform
|
||||
FROM koalaman/shellcheck:v0.10.0 as shellcheck
|
||||
|
@ -276,6 +277,11 @@ COPY --from=golang /usr/local/go/pkg/ /usr/lib/go/pkg/
|
|||
COPY --from=golang /usr/local/go/src/ /usr/lib/go/src/
|
||||
COPY --from=golangci-lint /usr/bin/golangci-lint /usr/bin/
|
||||
|
||||
######################
|
||||
# Install GoReleaser #
|
||||
######################
|
||||
COPY --from=goreleaser /usr/bin/goreleaser /usr/bin/
|
||||
|
||||
#####################
|
||||
# Install Terraform #
|
||||
#####################
|
||||
|
|
|
@ -67,6 +67,7 @@ Super-linter supports the following tools:
|
|||
| **Gherkin** | [gherkin-lint](https://github.com/vsiakka/gherkin-lint) |
|
||||
| **GitHub Actions** | [actionlint](https://github.com/rhysd/actionlint) |
|
||||
| **Golang** | [golangci-lint](https://github.com/golangci/golangci-lint) |
|
||||
| **GoReleser** | [GoReleser](https://github.com/goreleaser/goreleaser) |
|
||||
| **Groovy** | [npm-groovy-lint](https://github.com/nvuillam/npm-groovy-lint) |
|
||||
| **HTML** | [HTMLHint](https://github.com/htmlhint/HTMLHint) |
|
||||
| **Java** | [checkstyle](https://checkstyle.org) / [google-java-format](https://github.com/google/google-java-format) |
|
||||
|
@ -274,6 +275,7 @@ You can configure super-linter using the following environment variables:
|
|||
| **VALIDATE_GITLEAKS** | `true` | Flag to enable or disable the linting process of the secrets. |
|
||||
| **VALIDATE_GO** | `true` | Flag to enable or disable the linting process of the individual Golang files. Set this to `false` if you want to lint Go modules. See the `VALIDATE_GO_MODULES` variable. |
|
||||
| **VALIDATE_GO_MODULES** | `true` | Flag to enable or disable the linting process of Go modules. Super-linter considers a directory to be a Go module if it contains a file named `go.mod`. |
|
||||
| **VALIDATE_GO_RELEASER** | `true` | Flag to enable or disable the linting process of the GoReleaser config file. |
|
||||
| **VALIDATE_GOOGLE_JAVA_FORMAT** | `true` | Flag to enable or disable the linting process of the Java language. (Utilizing: google-java-format) |
|
||||
| **VALIDATE_GROOVY** | `true` | Flag to enable or disable the linting process of the language. |
|
||||
| **VALIDATE_HTML** | `true` | Flag to enable or disable the linting process of the HTML language. |
|
||||
|
|
|
@ -481,6 +481,8 @@ BuildFileArrays() {
|
|||
elif [ "${FILE_TYPE}" == "xml" ] ||
|
||||
[ "${FILE_TYPE}" == "xsd" ]; then
|
||||
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-XML"
|
||||
elif [[ "${FILE}" =~ .?goreleaser.+ya?ml ]]; then
|
||||
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-GO_RELEASER"
|
||||
elif [ "${FILE_TYPE}" == "yml" ] || [ "${FILE_TYPE}" == "yaml" ]; then
|
||||
echo "${FILE}" >>"${FILE_ARRAYS_DIRECTORY_PATH}/file-array-YAML"
|
||||
if DetectActions "${FILE}"; then
|
||||
|
|
|
@ -51,6 +51,7 @@ LINTER_COMMANDS_ARRAY_GHERKIN=(gherkin-lint -c "${GHERKIN_LINTER_RULES}")
|
|||
LINTER_COMMANDS_ARRAY_GO=(golangci-lint run -c "${GO_LINTER_RULES}" --fast)
|
||||
# Consume the input as we do with ANSIBLE
|
||||
LINTER_COMMANDS_ARRAY_GO_MODULES=(golangci-lint run --allow-parallel-runners -c "${GO_LINTER_RULES}" "&& echo \"Linted: {}\"")
|
||||
LINTER_COMMANDS_ARRAY_GO_RELEASER=(goreleaser check)
|
||||
LINTER_COMMANDS_ARRAY_GOOGLE_JAVA_FORMAT=(java -jar /usr/bin/google-java-format --dry-run --set-exit-if-changed)
|
||||
LINTER_COMMANDS_ARRAY_GROOVY=(npm-groovy-lint -c "${GROOVY_LINTER_RULES}" --failon warning --no-insight)
|
||||
LINTER_COMMANDS_ARRAY_HTML=(htmlhint --config "${HTML_LINTER_RULES}")
|
||||
|
|
|
@ -292,7 +292,7 @@ fi
|
|||
LANGUAGE_ARRAY=('ANSIBLE' 'ARM' 'BASH' 'BASH_EXEC' 'CHECKOV' 'CLANG_FORMAT'
|
||||
'CLOUDFORMATION' 'CLOJURE' 'COFFEESCRIPT' 'CPP' 'CSHARP' 'CSS' 'DART'
|
||||
'DOCKERFILE_HADOLINT' 'EDITORCONFIG' 'ENV' 'GITHUB_ACTIONS'
|
||||
'GITLEAKS' 'GHERKIN' 'GO' 'GO_MODULES' 'GOOGLE_JAVA_FORMAT' 'GROOVY' 'HTML' 'JAVA'
|
||||
'GITLEAKS' 'GHERKIN' 'GO' 'GO_MODULES' 'GO_RELEASER' 'GOOGLE_JAVA_FORMAT' 'GROOVY' 'HTML' 'JAVA'
|
||||
'JAVASCRIPT_ES' "${JAVASCRIPT_STYLE_NAME}" 'JSCPD' 'JSON' 'JSONC' 'JSX'
|
||||
'KUBERNETES_KUBECONFORM' 'KOTLIN' 'LATEX' 'LUA' 'MARKDOWN'
|
||||
'NATURAL_LANGUAGE' 'OPENAPI' 'PERL' 'PHP_BUILTIN' 'PHP_PHPCS' 'PHP_PHPSTAN'
|
||||
|
|
|
@ -25,6 +25,7 @@ LINTER_NAMES_ARRAY['GITLEAKS']="gitleaks"
|
|||
LINTER_NAMES_ARRAY['GHERKIN']="gherkin-lint"
|
||||
LINTER_NAMES_ARRAY['GO']="golangci-lint"
|
||||
LINTER_NAMES_ARRAY['GO_MODULES']="${LINTER_NAMES_ARRAY['GO']}"
|
||||
LINTER_NAMES_ARRAY['GO_RELEASER']="goreleaser"
|
||||
LINTER_NAMES_ARRAY['GOOGLE_JAVA_FORMAT']="google-java-format"
|
||||
LINTER_NAMES_ARRAY['GROOVY']="npm-groovy-lint"
|
||||
LINTER_NAMES_ARRAY['HTML']="htmlhint"
|
||||
|
|
|
@ -157,6 +157,7 @@ control "super-linter-installed-commands" do
|
|||
{ linter_name: "gherkin-lint", expected_exit_status: 1}, # expect a return code = 1 because this linter doesn't support a "get linter version" command
|
||||
{ linter_name: "gitleaks", version_option: "version"},
|
||||
{ linter_name: "golangci-lint"},
|
||||
{ linter_name: "goreleaser"},
|
||||
{ linter_name: "google-java-format", version_command: "java -jar /usr/bin/google-java-format --version"},
|
||||
{ linter_name: "hadolint"},
|
||||
{ linter_name: "htmlhint"},
|
||||
|
|
2
test/linters/go_releaser/.goreleaser_bad_1.yaml
Normal file
2
test/linters/go_releaser/.goreleaser_bad_1.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
brews:
|
||||
- folder: test
|
2
test/linters/go_releaser/.goreleaser_good_1.yaml
Normal file
2
test/linters/go_releaser/.goreleaser_good_1.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
brews:
|
||||
- directory: test
|
Loading…
Reference in a new issue