LoginSignup
3
2

More than 5 years have passed since last update.

タブ派のための checkstyle

Last updated at Posted at 2015-05-14

個人的には、checkstyle 自体が提供しているルールが、spece によるインデントフォーマットをとっているので、ぜひともそれを適用したい。しかし、歴史的な事情などによりタブによるインデントを強制させたいときがあった。

残念ながら checkstyle 自体はそういうルールは提供していないので、hibernate が使っている checkstyle ルールを使う。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
    <module name="TreeWalker">
        <!-- indent rule: via https://github.com/hibernate/hibernate-orm/blob/master/shared/config/checkstyle/checkstyle.xml#L35   -->
        <module name="RegexpSinglelineJava">
            <property name="ignoreComments" value="true" />
            <property name="format" value="^\t* +\t*\S" />
            <property name="message" value="Line has leading space characters; indentation should be performed with tabs only." />
        </module>
    </module>
</module>
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2