diff --git a/megalinter/Linter.py b/megalinter/Linter.py index c70ca3a68e3..0a6af015724 100644 --- a/megalinter/Linter.py +++ b/megalinter/Linter.py @@ -1225,7 +1225,9 @@ def build_lint_command(self, file=None) -> list: self.final_config_file = self.final_config_file.replace( self.workspace, DEFAULT_DOCKER_WORKSPACE_DIR ) - if self.cli_config_arg_name.endswith("="): + if self.cli_config_arg_name.endswith( + "=" + ) or self.cli_config_arg_name.endswith(":"): cmd += [self.cli_config_arg_name + self.final_config_file] elif self.cli_config_arg_name != "": cmd += [self.cli_config_arg_name, self.final_config_file] diff --git a/megalinter/descriptors/c.megalinter-descriptor.yml b/megalinter/descriptors/c.megalinter-descriptor.yml index abb0dfc8439..f3230d85930 100644 --- a/megalinter/descriptors/c.megalinter-descriptor.yml +++ b/megalinter/descriptors/c.megalinter-descriptor.yml @@ -39,7 +39,7 @@ linters: - "--Werror" - "--dry-run" config_file_name: .clang-format - cli_config_arg_name: "--style" + cli_config_arg_name: "--style=file:" cli_lint_errors_count: regex_count cli_lint_errors_regex: "code should be clang-formatted" examples: diff --git a/megalinter/descriptors/cpp.megalinter-descriptor.yml b/megalinter/descriptors/cpp.megalinter-descriptor.yml index b7cacb90fc7..7701147c144 100644 --- a/megalinter/descriptors/cpp.megalinter-descriptor.yml +++ b/megalinter/descriptors/cpp.megalinter-descriptor.yml @@ -49,7 +49,7 @@ linters: - "--Werror" - "--dry-run" config_file_name: .clang-format - cli_config_arg_name: "--style" + cli_config_arg_name: "--style=file:" cli_lint_errors_count: regex_count cli_lint_errors_regex: "code should be clang-formatted" examples: