You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Sunny Zhang <Su...@microsoft.com.INVALID> on 2019/09/26 17:48:28 UTC

Checkstyle can't add to IntelliJ

Hey!

I followed the code style check https://cwiki.apache.org/confluence/display/NIFI/Contributor+Guide
And add checkstyle plugin to IntelliJ, but when I wanna add nifi-checkstyle.xml https://gist.github.com/alopresto/67f43552c225468b92fcc9239072d737 to the configuration list, IntelliJ show me this error:

com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of LineLength Please review 'Parent Module' section for this Check in web documentation if Check is standard.
                at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:477)
                at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198)
                at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:61)
                at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:26)
                at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.executeCommand(CheckstyleActionsImpl.java:130)
                at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:60)
                at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:51)
                at org.infernus.idea.checkstyle.checker.CheckerFactoryWorker.run(CheckerFactoryWorker.java:46)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: TreeWalker is not allowed as a parent of LineLength Please review 'Parent Module' section for this Check in web documentation if Check is standard.
                at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:148)
                at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198)
                at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:472)
                ... 7 more

How to fix it? I downloaded the newest checkstyle 5.32.0.

Thanks!

Best,
Sunny

Re: Checkstyle can't add to IntelliJ

Posted by Andy LoPresto <al...@apache.org>.
The latest version of checkstyle is much higher - 8.24 according to their release notes [1]. You should not have to explicitly download the tool however, as importing the checkstyle file into IntelliJ should be sufficient. I have updated the gist you pointed to [2] with the exact contents of my current checkstyle.xml file. Please try with this version. 

[1] https://checkstyle.sourceforge.io/releasenotes.html <https://checkstyle.sourceforge.io/releasenotes.html>
[2] https://gist.github.com/alopresto/67f43552c225468b92fcc9239072d737/revisions <https://gist.github.com/alopresto/67f43552c225468b92fcc9239072d737/revisions>

Andy LoPresto
alopresto@apache.org
alopresto.apache@gmail.com
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On Sep 26, 2019, at 10:48 AM, Sunny Zhang <Su...@microsoft.com.INVALID> wrote:
> 
> Hey!
> 
> I followed the code style check https://cwiki.apache.org/confluence/display/NIFI/Contributor+Guide
> And add checkstyle plugin to IntelliJ, but when I wanna add nifi-checkstyle.xml https://gist.github.com/alopresto/67f43552c225468b92fcc9239072d737 to the configuration list, IntelliJ show me this error:
> 
> com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of LineLength Please review 'Parent Module' section for this Check in web documentation if Check is standard.
>                at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:477)
>                at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198)
>                at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:61)
>                at org.infernus.idea.checkstyle.service.cmd.OpCreateChecker.execute(OpCreateChecker.java:26)
>                at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.executeCommand(CheckstyleActionsImpl.java:130)
>                at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:60)
>                at org.infernus.idea.checkstyle.service.CheckstyleActionsImpl.createChecker(CheckstyleActionsImpl.java:51)
>                at org.infernus.idea.checkstyle.checker.CheckerFactoryWorker.run(CheckerFactoryWorker.java:46)
> Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: TreeWalker is not allowed as a parent of LineLength Please review 'Parent Module' section for this Check in web documentation if Check is standard.
>                at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:148)
>                at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198)
>                at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:472)
>                ... 7 more
> 
> How to fix it? I downloaded the newest checkstyle 5.32.0.
> 
> Thanks!
> 
> Best,
> Sunny