Skip to content

Commit

Permalink
Add cli_lint_fix_arg_name (#2175)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdovaz authored Dec 23, 2022
1 parent 1e86e15 commit d876f41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ linters:
linter_rules_configuration_url: https://github.com/PowerShell/PSScriptAnalyzer#explicit
linter_rules_inline_disable_url: https://github.com/PowerShell/PSScriptAnalyzer#suppressing-rules
config_file_name: .powershell-psscriptanalyzer.psd1
cli_lint_fix_arg_name: "-Fix"
version_extract_regex: "(\\d+) *(\\d+) *(\\d+)"
examples:
- 'pwsh -NoProfile -NoLogo -Command "Invoke-ScriptAnalyzer -EnableExit -Path myfile.ps1"'
Expand Down
2 changes: 2 additions & 0 deletions megalinter/linters/PowershellLinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def build_lint_command(self, file=None):
if self.config_file is not None:
pwsh_script[0] += " -Settings " + self.config_file
pwsh_script[0] += f" -Path '{file}'"
if self.apply_fixes is True and self.cli_lint_fix_arg_name is not None:
pwsh_script[0] += f" {self.cli_lint_fix_arg_name}"
cmd = [
self.cli_executable,
"-NoProfile",
Expand Down

0 comments on commit d876f41

Please sign in to comment.