nvuillam / npm-groovy-lint

Lint, format and auto-fix your Groovy / Jenkinsfile / Gradle files using command line
https://nvuillam.github.io/npm-groovy-lint/
MIT License
209 stars 65 forks source link

Error "unable to resolve class Library" with npm-groovy-lint@15.0.1 #422

Open geoffswift opened 3 months ago

geoffswift commented 3 months ago

Since 15.0.1 we see this error validating our Jenkins script:

Jenkinsfile.groovy
  0     error    Unknown parsing error: "Jenkinsfile.groovy: 1: unable to resolve class Library for annotation\n @ line 1, column 1.\n   @Library('ff-pipeline-lib@LKG') _\n   ^\n"  NglParseError

The problematic line of code looks like this:

  @Library('ff-pipeline-lib@LKG') _

I am using the "recommended-jenkinsfile" configuration.

I tried against these currently available versions:

15.0.0 - Good 15.0.1 - Bad 15.0.2 - Bad

edwardtew commented 3 months ago

I am also seeing this issue when using the latest code/container image

dahorak commented 3 months ago

We are facing the same issue.

nvuillam commented 3 months ago

@geoffswift @edwardtew @dahorak Until we find a fix, you can try with --no-parse as workaround

dahorak commented 3 months ago

Thanks for your suggestion, we stick to the previous 15.0.0 version as a workaround.

edwardtew commented 2 months ago

We have pinned the version at 15.0.0 for now as well. Thanks for the suggestion @nvuillam

Faisal-Bahoo commented 2 months ago

We faced the same issue, but using version 15.0.0 served as a workaround for us.

github-actions[bot] commented 1 month ago

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.

joshzcold commented 1 month ago

Bump. Don't close please

ajs139 commented 1 month ago

Same issue, using 15.0.0.

matt-undo commented 1 month ago

Yes, this issue prevents us from using a newer version. Please fix! Thank you!

nvuillam commented 1 month ago

I know I know... that's hard to find time these days ^^

Anyone is welcome to try bia a PR :)

github-actions[bot] commented 2 weeks ago

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.

moni-gomspace commented 2 weeks ago

I still would like to see this issue resolved

yermulnik commented 1 week ago

Running npm-groovy-lint via https://github.com/super-linter/super-linter bundle which has upgraded it to 15.0.2 yesterday and now we're hitting the below:

    0     error    Unknown parsing error: "/github/workspace/ami_build/Jenkinsfile: 2: unable to resolve class Library for annotation
   @ line 2, column 1.
     @Library('shared-library') _
     ^
  "  NglParseError
alexanderbazhenoff commented 5 days ago

Is there any way to disable them via groovylintrc.json?