-
Notifications
You must be signed in to change notification settings - Fork 132
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
UnnecessarySemicolonRule throws exceptions for Groovy 3 #506
Comments
I believe the root cause is in Groovy - https://issues.apache.org/jira/browse/GROOVY-9577 |
Can you please provide some sample code that causes the above exception, so I can add a test for that. |
Sure, there is a test that triggered the problem for me:
I added the test in
Basically, whenever you add some package that Groovy does not include by default, the error can occur. If it passes, try adding more imports from "non-standard" packages. |
I just noticed that the name of a test is wrong. Previously I suspected that rule failed because of additional annotations on a class. But it turns out that imports are the problem. |
Thanks for providing the sample code and pointing out the fix! |
I'm trying to run the latest CodeNarc from
master
on a Groovy 3 project (an exact groovy version is 3.0.4). However, UneccessarySemicoloRule throws IndexOutOfBoundException on line 69. After changing thecheckLastLineForSemicolon
method as shown below, everything started to work correctly.Tnx
The text was updated successfully, but these errors were encountered: