Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm-ttk linter throws error when the path it is analyzing has a space in it #1879

Closed
BrunoJuchli opened this issue Sep 16, 2022 · 6 comments · Fixed by #1889
Closed

arm-ttk linter throws error when the path it is analyzing has a space in it #1879

BrunoJuchli opened this issue Sep 16, 2022 · 6 comments · Fixed by #1889
Labels
bug Something isn't working

Comments

@BrunoJuchli
Copy link

Describe the bug
When the arm-ttk linter is enabled and there is an azure resource manager template file (*.arm.json) in a path containing a whitespace the linting errors out with an error like:

[arm-ttk] src/Functions/Properties/ServiceDependencies/3rdpartyimporttest - Zip Deploy/appInsights1.arm.json - ERROR - 1 error(s)
--Error detail:
Test-AzTemplate: 
Line |
   3 |  Test-AzTemplate @config -TemplatePath /github/workspace/src/Functions …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | A positional parameter cannot be found that accepts argument 'Deploy/appInsights1.arm.json'.

That is, megalinter fails to execute the linter.

To Reproduce
Steps to reproduce the behavior:

  1. add a file like:
    /src/Foo/Properties/ServiceDepencencies/some folder path with space/appInsights1.arm.json
  2. enable arm-ttk linter
  3. lint
  4. see error (megalinter fails to execute the linter)

Expected behavior
The linter should run

Additional context
The same problem also existed with the powershell linter, which was fixed: #1728

@BrunoJuchli BrunoJuchli added the bug Something isn't working label Sep 16, 2022
@Kurt-von-Laven
Copy link
Collaborator

Thank you for reporting this. To state the obvious, it sounds like we need to add some quotes somewhere.

@nvuillam
Copy link
Member

@Kurt-von-Laven I'm pretty sure that's here ->

def build_lint_command(self, file=None):
:)

nvuillam added a commit that referenced this issue Sep 20, 2022
nvuillam added a commit that referenced this issue Sep 20, 2022
@nvuillam
Copy link
Member

@BrunoJuchli it's solevd :)
please can you confirm it works with oxsecurity/megalinter:beta ?

@BrunoJuchli
Copy link
Author

@nvuillam
Tested and it works :-)

@BrunoJuchli
Copy link
Author

@nvuillam @Kurt-von-Laven
I wanted to add:
Thank you for looking into this and fixing it! This was really quick, too! 🥇

@nvuillam
Copy link
Member

@BrunoJuchli you're welcome, don't hesitate to star and share MegaLinter on social networks , the more users -> the more contributors and capabilities for MegaLinter :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants