Skip to content

Commit

Permalink
Fix npm-groovy-lint call
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Jan 17, 2022
1 parent 4e4145c commit 9380927
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Note: Can be used with `megalinter/megalinter@beta` in your GitHub Action mega-l

- Add linters licenses to online documentation
- Fix issue when config vars are both from ENV and from config file ([#1154](https://github.com/megalinter/megalinter/issues/1154))
- Fix issue of --files argument format when calling npm-groovy-lint ([#1176](https://github.com/megalinter/megalinter/issues/1176))

- Linter versions upgrades
- [coffeelint](http://www.coffeelint.org) from 5.2.2 to **5.2.3** on 2022-01-09
Expand Down
7 changes: 4 additions & 3 deletions megalinter/linters/GroovyNpmGroovyLintLinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class GroovyNpmGroovyLintLinter(Linter):

# Build the CLI command to call to lint a file
def build_lint_command(self, file=None):
dir_name = os.path.dirname(file)
file_name = os.path.basename(file)
cmd = [self.cli_executable]
# Add other lint cli arguments if defined
cmd += self.cli_lint_extra_args
Expand All @@ -24,7 +22,10 @@ def build_lint_command(self, file=None):
self.try_fix = True
# Add user-defined extra arguments if defined
cmd += self.cli_lint_user_args
cmd += ["--path ", dir_name, "--files ", f"**/{file_name}"]
if self.cli_lint_mode == 'file':
dir_name = os.path.dirname(file)
file_name = os.path.basename(file)
cmd += ["--path ", dir_name, "--files ", f"{file_name}"]
if self.config_file is not None:
cmd += [self.cli_config_arg_name, self.config_file]
return cmd

0 comments on commit 9380927

Please sign in to comment.