mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-24 15:11:09 -05:00
feat: add clang-format style configuration (#5424)
This commit is contained in:
parent
e71a37d49d
commit
0ae4572874
5 changed files with 6 additions and 1 deletions
|
@ -194,6 +194,7 @@ You can configure super-linter using the following environment variables:
|
||||||
| **BASH_EXEC_IGNORE_LIBRARIES** | `false` | If set to `true`, shell files with a file extension and no shebang line are ignored when checking if the executable bit is set. |
|
| **BASH_EXEC_IGNORE_LIBRARIES** | `false` | If set to `true`, shell files with a file extension and no shebang line are ignored when checking if the executable bit is set. |
|
||||||
| **BASH_SEVERITY** | `style` | Specify the minimum severity of errors to consider in shellcheck. Valid values in order of severity are error, warning, info and style. |
|
| **BASH_SEVERITY** | `style` | Specify the minimum severity of errors to consider in shellcheck. Valid values in order of severity are error, warning, info and style. |
|
||||||
| **CHECKOV_FILE_NAME** | `.checkov.yaml` | Configuration filename for Checkov. |
|
| **CHECKOV_FILE_NAME** | `.checkov.yaml` | Configuration filename for Checkov. |
|
||||||
|
| **CLANG_FORMAT_FILE_NAME** | `.clang-format` | Configuration filename for [clang-format](https://clang.llvm.org/docs/ClangFormatStyleOptions.html). |
|
||||||
| **CREATE_LOG_FILE** | `false` | If set to `true`, it creates the log file. You can set the log filename using the `LOG_FILE` environment variable. This overrides any existing log files. |
|
| **CREATE_LOG_FILE** | `false` | If set to `true`, it creates the log file. You can set the log filename using the `LOG_FILE` environment variable. This overrides any existing log files. |
|
||||||
| **CSS_FILE_NAME** | `.stylelintrc.json` | Filename for [Stylelint configuration](https://github.com/stylelint/stylelint) (ex: `.stylelintrc.yml`, `.stylelintrc.yaml`) |
|
| **CSS_FILE_NAME** | `.stylelintrc.json` | Filename for [Stylelint configuration](https://github.com/stylelint/stylelint) (ex: `.stylelintrc.yml`, `.stylelintrc.yaml`) |
|
||||||
| **DEFAULT_BRANCH** | Default repository branch when running on GitHub Actions, `master` otherwise | The name of the repository default branch. There's no need to configure this variable when running on GitHub Actions |
|
| **DEFAULT_BRANCH** | Default repository branch when running on GitHub Actions, `master` otherwise | The name of the repository default branch. There's no need to configure this variable when running on GitHub Actions |
|
||||||
|
|
1
TEMPLATES/.clang-format
Normal file
1
TEMPLATES/.clang-format
Normal file
|
@ -0,0 +1 @@
|
||||||
|
BasedOnStyle: LLVM
|
|
@ -31,7 +31,7 @@ else
|
||||||
debug "Adding the '--directory' option to the Checkov command."
|
debug "Adding the '--directory' option to the Checkov command."
|
||||||
LINTER_COMMANDS_ARRAY_CHECKOV+=(--directory)
|
LINTER_COMMANDS_ARRAY_CHECKOV+=(--directory)
|
||||||
fi
|
fi
|
||||||
LINTER_COMMANDS_ARRAY_CLANG_FORMAT=(clang-format --Werror --dry-run)
|
LINTER_COMMANDS_ARRAY_CLANG_FORMAT=(clang-format --style=file:"${CLANG_FORMAT_LINTER_RULES}" --Werror --dry-run)
|
||||||
LINTER_COMMANDS_ARRAY_CLOJURE=(clj-kondo --config "${CLOJURE_LINTER_RULES}" --lint)
|
LINTER_COMMANDS_ARRAY_CLOJURE=(clj-kondo --config "${CLOJURE_LINTER_RULES}" --lint)
|
||||||
LINTER_COMMANDS_ARRAY_CLOUDFORMATION=(cfn-lint --config-file "${CLOUDFORMATION_LINTER_RULES}")
|
LINTER_COMMANDS_ARRAY_CLOUDFORMATION=(cfn-lint --config-file "${CLOUDFORMATION_LINTER_RULES}")
|
||||||
LINTER_COMMANDS_ARRAY_COFFEESCRIPT=(coffeelint -f "${COFFEESCRIPT_LINTER_RULES}")
|
LINTER_COMMANDS_ARRAY_COFFEESCRIPT=(coffeelint -f "${COFFEESCRIPT_LINTER_RULES}")
|
||||||
|
|
|
@ -152,6 +152,8 @@ ARM_FILE_NAME=".arm-ttk.psd1"
|
||||||
BASH_SEVERITY="${BASH_SEVERITY:-""}"
|
BASH_SEVERITY="${BASH_SEVERITY:-""}"
|
||||||
CHECKOV_FILE_NAME="${CHECKOV_FILE_NAME:-".checkov.yaml"}"
|
CHECKOV_FILE_NAME="${CHECKOV_FILE_NAME:-".checkov.yaml"}"
|
||||||
# shellcheck disable=SC2034 # Variable is referenced indirectly
|
# shellcheck disable=SC2034 # Variable is referenced indirectly
|
||||||
|
CLANG_FORMAT_FILE_NAME="${CLANG_FORMAT_FILE_NAME:-".clang-format"}"
|
||||||
|
# shellcheck disable=SC2034 # Variable is referenced indirectly
|
||||||
CLOJURE_FILE_NAME=".clj-kondo/config.edn"
|
CLOJURE_FILE_NAME=".clj-kondo/config.edn"
|
||||||
# shellcheck disable=SC2034 # Variable is referenced indirectly
|
# shellcheck disable=SC2034 # Variable is referenced indirectly
|
||||||
CLOUDFORMATION_FILE_NAME=".cfnlintrc.yml"
|
CLOUDFORMATION_FILE_NAME=".cfnlintrc.yml"
|
||||||
|
|
|
@ -474,6 +474,7 @@ control "super-linter-validate-files" do
|
||||||
"/action/lib/.automation/.cfnlintrc.yml",
|
"/action/lib/.automation/.cfnlintrc.yml",
|
||||||
"/action/lib/.automation/.checkov.yaml",
|
"/action/lib/.automation/.checkov.yaml",
|
||||||
"/action/lib/.automation/.chktexrc",
|
"/action/lib/.automation/.chktexrc",
|
||||||
|
"/action/lib/.automation/.clang-format",
|
||||||
"/action/lib/.automation/.clj-kondo",
|
"/action/lib/.automation/.clj-kondo",
|
||||||
"/action/lib/.automation/.coffee-lint.json",
|
"/action/lib/.automation/.coffee-lint.json",
|
||||||
"/action/lib/.automation/.ecrc",
|
"/action/lib/.automation/.ecrc",
|
||||||
|
|
Loading…
Reference in a new issue