From 4a4ab1ed473ecd01b0c512582b838964a131169f Mon Sep 17 00:00:00 2001 From: kema Date: Thu, 20 Feb 2025 17:55:46 +0100 Subject: [PATCH] feat(golangci-lint): add possibility to specify custom config file (#6558) --- README.md | 1 + lib/globals/linterRules.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b741336..08c63c4e 100644 --- a/README.md +++ b/README.md @@ -284,6 +284,7 @@ You can configure Super-linter using the following environment variables: | **GITHUB_DOMAIN** | `github.com` | Specify a custom GitHub domain in case GitHub Enterprise is used: e.g. `github.myenterprise.com`. `GITHUB_DOMAIN` is a convenience configuration variable to automatically build `GITHUB_CUSTOM_API_URL` and `GITHUB_CUSTOM_SERVER_URL`. | | **GITLEAKS_CONFIG_FILE** | `.gitleaks.toml` | Filename for [GitLeaks configuration](https://github.com/zricethezav/gitleaks#configuration) (ex: `.gitleaks.toml`) | | **GITLEAKS_LOG_LEVEL** | Gitleaks default log level | Gitleaks log level. Defaults to the Gitleaks default log level. | +| **GO_CONFIG_FILE** | `.golangci.yml` | Filename for [golangci-lint configuration](https://golangci-lint.run/usage/configuration/) (ex: `.golangci.toml`) | | **IGNORE_GENERATED_FILES** | `false` | If set to `true`, super-linter will ignore all the files with `@generated` marker but without `@not-generated` marker. Jscpd and Checkov ignore this variable. Use their include and ignore features to select or ignore the files to lint. | | **IGNORE_GITIGNORED_FILES** | `false` | If set to `true`, super-linter will ignore all the files that are ignored by Git. Checkov ignores this variable. Use its include and ignore features to select or ignore the files to lint. | | **JAVA_FILE_NAME** | `sun_checks.xml` | Filename for [Checkstyle configuration](https://checkstyle.sourceforge.io/config.html). Checkstyle embeds several configuration files, such as `sun_checks.xml`, `google_checks.xml` that you can use without providing your own configuration file. | diff --git a/lib/globals/linterRules.sh b/lib/globals/linterRules.sh index 27cb81c1..b5608370 100755 --- a/lib/globals/linterRules.sh +++ b/lib/globals/linterRules.sh @@ -29,7 +29,7 @@ GITLEAKS_FILE_NAME="${GITLEAKS_CONFIG_FILE:-.gitleaks.toml}" # shellcheck disable=SC2034 # Variable is referenced indirectly GHERKIN_FILE_NAME=".gherkin-lintrc" # shellcheck disable=SC2034 # Variable is referenced indirectly -GO_FILE_NAME=".golangci.yml" +GO_FILE_NAME="${GO_CONFIG_FILE:-.golangci.yml}" # shellcheck disable=SC2034 # Variable is referenced indirectly GROOVY_FILE_NAME=".groovylintrc.json" # shellcheck disable=SC2034 # Variable is referenced indirectly