From 647f4c67ef4e4d8cd49d8103784e574fa69ad118 Mon Sep 17 00:00:00 2001 From: nvuillam Date: Tue, 20 Sep 2022 22:35:36 +0200 Subject: [PATCH] Add quote to arm-ttk linter command Fixes https://github.com/oxsecurity/megalinter/issues/1879 quick build --- CHANGELOG.md | 2 ++ megalinter/linters/ArmLinter.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9f454ee76b..7fd029a11e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 quotes to arm-ttk linter command ([#1879](https://github.com/oxsecurity/megalinter/issues/1879)) + - Linter versions upgrades - [cfn-lint](https://github.com/aws-cloudformation/cfn-lint) from 0.65.0 to **0.65.1** on 2022-09-20 - [checkov](https://www.checkov.io/) from 2.1.213 to **2.1.214** on 2022-09-20 diff --git a/megalinter/linters/ArmLinter.py b/megalinter/linters/ArmLinter.py index f24de6d89e4..ce33aa0e1a4 100644 --- a/megalinter/linters/ArmLinter.py +++ b/megalinter/linters/ArmLinter.py @@ -19,10 +19,10 @@ def build_lint_command(self, file=None): '${config} = $(Import-PowerShellDataFile -Path "' + self.config_file + '") ;', - "Test-AzTemplate @config -TemplatePath " + file + " ;", + f"Test-AzTemplate @config -TemplatePath '{file}' ;", ] else: - pwsh_script += ["Test-AzTemplate -TemplatePath " + file + " ;"] + pwsh_script += [f"Test-AzTemplate -TemplatePath '{file}' ;"] pwsh_script += ["if (${Error}.Count) {exit 1}"] cmd = [ ("powershell" if sys.platform == "win32" else "pwsh"),