[
https://issues.apache.org/jira/browse/CALCITE-487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14236698#comment-14236698
]
Vladimir Sitnikov commented on CALCITE-487:
-------------------------------------------
{quote} It's the only incompatibility between Intellij and Checkstyle I have
noticed{quote}
Unfortunately, it is not.
See my <<"non indented" names>> in the description:
[Linq4jTest.groupingKeyExtractor|https://github.com/apache/incubator-calcite/blob/ca980a469702224c458c9e3473e679ff491c3578/linq4j/src/test/java/org/apache/calcite/linq4j/test/Linq4jTest.java#L580].
New checkstyle wants somehow to indent the method name, while IDEA suggests
zero additional indentation when name of the method/variable is moved to the
next line.
{quote} See
https://github.com/julianhyde/share/blob/master/tools/emacsValidate{quote}
This is covered by https://github.com/jshiell/checkstyle-idea plugin. It allows
you to run checkstyle for a current file, module, project, set of modified
files, etc.
If you want just open a specific file and line, you can still do that from the
command line:
https://www.jetbrains.com/idea/help/working-with-intellij-idea-features-from-command-line.html#d1072773e251
Eclipse seems to be missing "line number" part of the command line:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=305336
> Update checkstyle to 6.1.1
> --------------------------
>
> Key: CALCITE-487
> URL: https://issues.apache.org/jira/browse/CALCITE-487
> Project: Calcite
> Issue Type: Wish
> Affects Versions: 1.0.0-incubating
> Reporter: Vladimir Sitnikov
> Assignee: Julian Hyde
>
> Checkstyle 6.1.1 offers more consistent handling of indentations.
> I do not like that current checkstyle 5.7 tries to make arrays 2-indented,
> while IDEA makes them 4-aligned.
> I wish the style is as IDE-compatible as it could be (i.e. "reformat code" in
> IDE should result in checkstyle-acceptable code).
> The update is as "easy" as putting the following into pom.xml:
> {code:xml}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-checkstyle-plugin</artifactId>
> <version>2.12.1</version>
> <dependencies>
> <dependency>
> <groupId>com.puppycrawl.tools</groupId>
> <artifactId>checkstyle</artifactId>
> <version>6.1.1</version>
> </dependency>
> </dependencies>
> </plugin>{code}
> Checkstyle 6.1.1 complains a lot on array initializers.
> I did not manage to get "non indented" names of methods like
> {{groupingKeyExtractor}} in
> {code:java}
> private static <K extends Comparable, V> Function1<Grouping<K, V>, K>
> groupingKeyExtractor() { // IDEA adds no indentation here, however
> checkstyle wants "6" here
> return new Function1<Grouping<K, V>, K>() {
> public K apply(Grouping<K, V> a0) {
> return a0.getKey();
> }
> };
> }{code}
> With the following additions, the number of warnings is much less, however I
> wish the final style is IDE-compatible.
> {code:xml}
> <module name="Indentation">
> <property name="caseIndent" value="0"/>
> <property name="basicOffset" value="2"/>
> <property name="braceAdjustment" value="0"/>
> <property name="arrayInitIndent" value="2"/> <-- added -->
> <property name="throwsIndent" value="4"/> <-- added -->
> <property name="lineWrappingIndentation" value="4"/> <-- added -->
> </module>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)