-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Closed
Copy link
Milestone
Description
$ javac -fullversion
javac full version "20-ea+35-2342"
$ javac T.java
$ wget https://raw.githubusercontent.com/checkstyle/checkstyle/d02e867225c3eaa43dc681c2827ce89799dee88f/src/main/resources/google_checks.xml
$ cat T.java
class T {
void doSomething(int i) {
String s =
switch (i) {
case 1 -> "one";
case 2 -> "two";
default -> throw new AssertionError();
};
}
}
$ RUN_LOCALE="-Duser.language=en -Duser.country=US"
$ java -jar checkstyle-10.8.1-all.jar -c google_checks.xml T.java
Starting audit...
[WARN] /tmp/tmp.zK57404080/T.java:4:9: 'switch' has incorrect indentation level 8, expected level should be 4. [Indentation]
[WARN] /tmp/tmp.zK57404080/T.java:5:11: 'case' child has incorrect indentation level 10, expected level should be 6. [Indentation]
[WARN] /tmp/tmp.zK57404080/T.java:6:11: 'case' child has incorrect indentation level 10, expected level should be 6. [Indentation]
[WARN] /tmp/tmp.zK57404080/T.java:7:11: 'case' child has incorrect indentation level 10, expected level should be 6. [Indentation]
[WARN] /tmp/tmp.zK57404080/T.java:8:9: 'switch rcurly' has incorrect indentation level 8, expected level should be 4. [Indentation]
Audit done.
Describe what you expect in detail.
I expected no errors to be produced, because the input is formatted in a way that complies with the Google Java Style Guide
JakeTheSnake, falkoschumann, valentinbogdanov, pyaqubzade, mfrey43 and 4 more
Metadata
Metadata
Assignees
Type
Projects
Status
Done