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

v15.0.1 regression: NglParseError when trying to lint a groovy shared library via pre-commit #428

Open
ClementDelannoySlateDigital opened this issue Sep 13, 2024 · 5 comments

Comments

@ClementDelannoySlateDigital

"unable to resolve class ..." at each internal import.

I guess this is due to the fact it awaits for an explicit @Library import in this environment

@pkolomytsev
Copy link

I faced the same problem. I have a Jenkinsfile with the statement @Library(['[email protected]']) _. This library is resolvable only in our Jenkins environment. NglParseError also ignores /* groovylint-disable-next-line */. This issue appeared in version v15.0.1.

@ClementDelannoySlateDigital
Copy link
Author

Thanks for the information, it also works for me with v15.0.0 :)

@ClementDelannoySlateDigital ClementDelannoySlateDigital changed the title NglParseError when trying to lint a groovy shared library via pre-commit v15.0.1 regression: NglParseError when trying to lint a groovy shared library via pre-commit Sep 30, 2024
@kpoxo6op
Copy link

same issue, rolling back to v15.0.0

Jenkinsfile

/* groovylint-disable NglParseError */
import groovy.text.*
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils

15.0.2

docker run --rm -it -v $(pwd):/app/code --entrypoint npm-groovy-lint nvuillam/npm-groovy-lint:v15.0.2 --no-insight --noserver --nolintafter /app/code

/app/code/Jenkinsfile
  0     error    Unknown parsing error: "/app/code/Jenkinsfile: 3: unable to resolve class org.jenkinsci.plugins.pipeline.modeldefinition.Utils\n @ line 3, column 1.\n   import org.jenkinsci.plugins.pipeline.modeldefinition.Utils\n   ^\n"  NglParseError

15.0.1 is the same

docker run --rm -it -v $(pwd):/app/code --entrypoint npm-groovy-lint nvuillam/npm-groovy-lint:v15.0.2 --no-insight --noserver --nolintafter /app/code

15.0.0 respects /* groovylint-disable NglParseError */

docker run --rm -it -v $(pwd):/app/code --entrypoint npm-groovy-lint nvuillam/npm-groovy-lint:v15.0.0 --no-insight --noserver --nolintafter /app/code
/app/code/Jenkinsfile
  2     info     Wildcard (star) import  NoWildcardImports       
  3     info     The [org.jenkinsci.plugins.pipeline.modeldefinition.Utils] import is never referenced  UnusedImport   

@yermulnik
Copy link

Please look into rectifying this. We've got our Jenkinsfiles linting automation broken 😢
#422 (comment)

ferrarimarco added a commit to super-linter/super-linter that referenced this issue Nov 19, 2024
ferrarimarco added a commit to super-linter/super-linter that referenced this issue Nov 20, 2024
@alexanderbazhenoff
Copy link

Also need @Library and unresolved classes workaround. Please read here.

Any way to fix this via config or comments?

ferrarimarco added a commit to super-linter/super-linter that referenced this issue Nov 27, 2024
ferrarimarco added a commit to super-linter/super-linter that referenced this issue Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants