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

npm-groovy-lint is raising a false positive error on GitHub Actions #1872

Closed
tylervz opened this issue Sep 14, 2022 · 3 comments · Fixed by #1973
Closed

npm-groovy-lint is raising a false positive error on GitHub Actions #1872

tylervz opened this issue Sep 14, 2022 · 3 comments · Fixed by #1973
Labels
bug Something isn't working

Comments

@tylervz
Copy link

tylervz commented Sep 14, 2022

Describe the bug
npm-groovy-lint is reporting it found 1 error when it linted the Groovy files on our branch in the GitHub Actions MegaLinter workflow, but when we expand the report for details it shows that no rules of the "Error" severity were actually broken. I would expect npm-groovy-lint Info and Warning statements to not result in an error, causing the MegaLinter job to fail on GitHub actions.

✅ Linted [REPOSITORY] files with [git_diff] successfully - (0.25s) (expand for details)
❌ Linted [GROOVY] files with [npm-groovy-lint]: Found 1 error(s) - (38.13s) (expand for details)

...

npm-groovy-lint results in 6 linted files:
  ┌─────────┬───────────┬─────────────┐
  │ (index) │ Severity  │ Total found │
  ├─────────┼───────────┼─────────────┤
  │    0    │  'Error'  │      0      │
  │    1    │ 'Warning' │     101     │
  │    2    │  'Info'   │     586     │
  └─────────┴───────────┴─────────────┘
  

+----SUMMARY------+----------------------+---------------+-------+-------+--------+--------------+
| Descriptor      | Linter               | Mode          | Files | Fixed | Errors | Elapsed time |
+-----------------+----------------------+---------------+-------+-------+--------+--------------+
| ✅ EDITORCONFIG | editorconfig-checker | list_of_files |     6 |       |      0 |        0.13s |
| ❌ GROOVY       | npm-groovy-lint      | list_of_files |     6 |       |      1 |       38.13s |
| ✅ REPOSITORY   | checkov              | project       |   n/a |       |      0 |       22.88s |
| ✅ REPOSITORY   | dustilock            | project       |   n/a |       |      0 |         0.8s |
| ✅ REPOSITORY   | git_diff             | project       |   n/a |       |      0 |        0.25s |
| ✅ REPOSITORY   | secretlint           | project       |   n/a |       |      0 |         7.1s |
| ✅ REPOSITORY   | syft                 | project       |   n/a |       |      0 |         2.4s |
| ✅ REPOSITORY   | trivy                | project       |   n/a |       |      0 |        3.71s |
+-----------------+----------------------+---------------+-------+-------+--------+--------------+

The full MegaLinter log of the npm-groovy-lint run can be found here:
ERROR-GROOVY_NPM_GROOVY_LINT.log

To Reproduce
Steps to reproduce the behavior:

  1. Create or find an existing project that uses Groovy files.
  2. Download our MegaLinter GitHub actions workflow.
  3. Download our MegaLinter config to the root directory of the project.
  4. Download our npm-groovy-lint config to the root directory of the project.

Expected behavior
I would expect npm-groovy-lint Info and Warning statements to not result in an error, causing the MegaLinter job to fail on GitHub actions.

@tylervz tylervz added the bug Something isn't working label Sep 14, 2022
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Oct 15, 2022
@tylervz
Copy link
Author

tylervz commented Oct 17, 2022

Let me know if you need me to create a sample repo for this issue.

@github-actions github-actions bot removed the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Oct 17, 2022
@nvuillam
Copy link
Member

nvuillam commented Oct 17, 2022

@tylervz it is an expected behavior to fail if issues are found by npm-groovy-lint, even if they are at info level

I'll make an update allowing you to override such behavior and make than only issues with level "error" makes MegaLinter fail

No need to make a sample repo, I'm also the creator and maintainer of npm-groovy-lint ^^

nvuillam added a commit that referenced this issue Oct 17, 2022
nvuillam added a commit that referenced this issue Oct 17, 2022
* Remove default npm-groovy-lint extra arguments

Fixes #1872

* [MegaLinter] Apply linters fixes

Co-authored-by: nvuillam <nvuillam@users.noreply.github.com>
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.

2 participants