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

upgrade to checkstyle 8.2 #124

Closed
romani opened this issue Aug 31, 2017 · 4 comments
Closed

upgrade to checkstyle 8.2 #124

romani opened this issue Aug 31, 2017 · 4 comments
Labels

Comments

@romani
Copy link
Member

romani commented Aug 31, 2017

http://checkstyle.sourceforge.net/releasenotes.html#Release_8.2 ,
upgrade version at https://github.com/checkstyle/sonar-checkstyle/edit/master/pom.xml#L88

==============

FROM CHECKSTYLE RELEASE NOTES that might affect plugin

Breaking backward compatibility:

JavadocParser: inconsistent AST tree with and without SINGLETON_ELEMENT. 
move AbstractTypeAwareCheck and ClassResolver to javadoc package. 
remove deprecated property maxLineLength from LeftCurlyCheck. 
remove FileContentsHolder module as FileContents object is available for filters on TreeWalker in TreeWalkerAudit Event.
Replace terms in AST Tokens by terms from HTML specification.

New:

new Check: single line annotation location.
Add HTML5 tags support to Javadoc antlr4 grammar and related classes. 
UnnecessaryParentheses: Reject parentheses around single parameters in lambdas. 
Add token type to LocalizedMessage. 

ATTENTION (migration notes):
1)if happens:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project checkstyle-sonar-plugin-parent: Can not execute Checkstyle: cannot initialize module TreeWalker - Property 'maxLineLength' in module LeftCurly does not exist, please check the documentation -> [Help 1]
solution is to remove "Custom Rule" and recreate it from "Rule Template"
old rule:
image
new rule should be without property:
image

  1. for UnnecessaryParentheses Rule, LAMBDA token has to added manually in UI or recreate rule from scratch.
@tsjensen
Copy link
Contributor

tsjensen commented Sep 7, 2017

What is your current strategy with SonarQube? I see that the last release was for Checkstyle 7.7. For a time it seemed that you would be releasing a matching SonarQube plugin for every Checkstyle release. At which interval do you plan to make SonarQube plugin releases? Thanks for the info.

@romani
Copy link
Member Author

romani commented Sep 7, 2017

sorry , we just run out of time to support main project and this plugin, and to keep it in sync.
We had too much activity in main project.

I did updates when I had time for this. There a lot of PRs, more blocker issues in main project, so for now no time to update plugin and test it.

If smb have time, please to update of sonar plugin to new version of checkstyle, version by version ... to let final users freedom to choose on what version to stay.
I will do releases for each version, release take not that much time.

@romani
Copy link
Member Author

romani commented Dec 28, 2017

upgrade to 8.2 result in build problem:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project checkstyle-sonar-plugin: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
[ERROR] java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
[ERROR] at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:314)
[ERROR] at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:268)
[ERROR] at java.util.jar.JarVerifier.processEntry(JarVerifier.java:316)
[ERROR] at java.util.jar.JarVerifier.update(JarVerifier.java:228)
[ERROR] at java.util.jar.JarFile.initializeVerifier(JarFile.java:383)
[ERROR] at java.util.jar.JarFile.getInputStream(JarFile.java:450)
[ERROR] at sun.misc.URLClassPath$JarLoader$2.getInputStream(URLClassPath.java:977)
[ERROR] at sun.misc.Resource.cachedInputStream(Resource.java:77)
[ERROR] at sun.misc.Resource.getByteBuffer(Resource.java:160)
[ERROR] at java.net.URLClassLoader.defineClass(URLClassLoader.java:454)
[ERROR] at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
[ERROR] at java.security.AccessController.doPrivileged(Native Method)
[ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[ERROR] at java.lang.Class.getDeclaredMethods0(Native Method)
[ERROR] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
[ERROR] at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
[ERROR] at java.lang.Class.getMethod0(Class.java:3018)
[ERROR] at java.lang.Class.getMethod(Class.java:1784)
[ERROR] at org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod(ReflectionUtils.java:61)
[ERROR] at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isSuiteOnly(JUnit3TestChecker.java:64)
[ERROR] at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isValidJUnit3Test(JUnit3TestChecker.java:59)
[ERROR] at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.accept(JUnit3TestChecker.java:54)
[ERROR] at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:52)
[ERROR] at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:98)
[ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:311)
[ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.setTestsToRun(JUnit4Provider.java:191)
[ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:134)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :checkstyle-sonar-plugin

conflict with Saxon:

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.025 sec - in org.sonar.plugins.checkstyle.CheckstyleConfigurationTest
Running org.sonar.plugins.checkstyle.CheckstyleProfileExporterTest
Error on line 1 of file:/home/rivanov/java/github/checkstyle/sonar-checkstyle/checkstyle-sonar-plugin/./:
  XTDE0160: XSLT 1.0 compatibility mode is not available in this configuration

romani added a commit that referenced this issue Dec 28, 2017
@romani
Copy link
Member Author

romani commented Dec 28, 2017

TODO:

remove deprecated property maxLineLength from LeftCurlyCheck.

manual test is required - DONE.
migration notes - provided to issue description.

remove FileContentsHolder module as FileContents object is available for filters on TreeWalker in TreeWalkerAudit Event.

test is required that filters works - done.
migration notes - nothing is required.

new Check: single line annotation location.

manual test is required - WORKS FINE.

UnnecessaryParentheses: Reject parentheses around single parameters in lambdas.

manual test is required - done.
migration notes - new token LAMDBA has to be added to Rules if required, as defaults stored explicitly in Sonar, so rule keep them defined (previous version did not have such token).

@romani romani closed this as completed Dec 28, 2017
tsjensen pushed a commit to checkstyle-addons/sonar-checkstyle that referenced this issue Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants