https://checkstyle.org/checks/misc/indentation.html#Indentation
/var/tmp $ javac TestClass.java:
/var/tmp $ cat TestClass.java:
class TestClass {
void method() {
try { return; // Line 3
}
catch (Exception e) { return; // Line 5
}
}
}
/var/tmp $ cat config.xml:
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="Indentation"/>
</module>
</module>
/var/tmp $ java -Duser.language=en -Duser.country=US -jar checkstyle-8.8-all.jar -c config.xml TestClass.java:
Starting audit...
[ERROR] /var/tmp/TestClass.java:3: 'try' child has incorrect indentation level 8, expected level should be 12. [Indentation]
[ERROR] /var/tmp/TestClass.java:5: 'catch' child has incorrect indentation level 8, expected level should be 12. [Indentation]
Audit done.
Checkstyle ends with 1 errors.
There should be no violations.
https://checkstyle.org/checks/misc/indentation.html#Indentation
/var/tmp $ javac TestClass.java:/var/tmp $ cat TestClass.java:/var/tmp $ cat config.xml:/var/tmp $ java -Duser.language=en -Duser.country=US -jar checkstyle-8.8-all.jar -c config.xml TestClass.java:There should be no violations.