Closed tylervz closed 11 months ago
npm-groovy-lint (whose i'm the author and maintainer) is in really bad shape, and I don't code in java/groovy for year so it's hard to find the time to make the fixes
But @stevenh is working on it, I have good hopes for a next nice working again version :)
I discovered what Groovy code in my repository was causing npm-groovy-lint to behave that way in MegaLinter:
class ExampleService {
/* groovylint-disable GrailsStatelessService, LineLength */
/**
* Here is a comment with some really long lines:
* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Augue interdum velit euismod .
* Cras semper auctor neque vitae tempus quam. Duis ultricies lacus sed turpis. Purus semper eget duis at. Ac auctor augue mauris augue neque gravida in fermentum et.
*/
/* groovylint-enable LineLength */
...
}
Changing it to the following solved the issue for me:
class ExampleService {
/* groovylint-disable GrailsStatelessService */
/* groovylint-disable LineLength */
/**
* Here is a comment with some really long lines:
* Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Augue interdum velit euismod .
* Cras semper auctor neque vitae tempus quam. Duis ultricies lacus sed turpis. Purus semper eget duis at. Ac auctor augue mauris augue neque gravida in fermentum et.
*/
/* groovylint-enable LineLength */
...
}
@nvuillam do you want me to open an issue in npm-groovy-lint for displaying better error messaging when users do not adhere to one of the documented formats for disabling rules in source? Or would npm-groovy-lint normally have displayed a helpful warning/error message in this case if it were not due to npm-groovy-lint being in really bad shape (because it does not support modern Java and Node versions)?
Regardless, I'm going to close this issue since the mystery has been solved.
Describe the bug In the GitHub actions workflow,
npm-groovy-lint
is failing with the messageUnexpected error: console.warning is not a function
. I first noticed this issue happening on October 20, 2023.To Reproduce Unfortunately, I can't provide a link to the private repository where the issue is happening and I haven't been able to pinpoint how to reproduce the error. I just wanted to open this issue in case anybody else was experiencing this and could add some additional context. Maybe in the next week or two I'll be able to reproduce the error in a public repository.
Re-running the workflow results in the same error. However, if I cherry pick the changes from the branch where the workflow is failing, and I commit on a new branch a subset of the changes to
.groovy
files, then sometimes the error does not occur (depending on the subset of changes committed).Here's my
.mega-linter.yml
file:Here's the GH Actions workflow file:
And here's my
.groovylintrc.json
Expected behavior
npm-groovy-lint
should finish running and report any issues it discovered in the source code.Additional context Our project has the
eslint-plugin-qunit
package listed underdevDependencies
in thepackage.json
in our repository to enable additional rules for ESLint. In.eslintrc.yml
, we have the followingextends: ["eslint:recommended", "plugin:qunit/recommended"]
In order to have the MegaLinter run ESLint with the
"plugin:qunit/recommended"
rules applied, I added the "Setup node" and "npm install" steps to our GH Actions workflow. Commenting out these steps does not seem to fix the issue I'm having withnpm-groovy-lint
.