FileTabCharacter
Since Checkstyle 5.0
Description
'\t') in the source code.
        Rationale:
- Developers should not need to configure the tab width of their text editors in order to be able to read source code.
 - From the Apache jakarta coding standards: In a distributed development environment, when the commit messages get sent to a mailing list, they are almost impossible to read if you use tabs.
 
Notes
          When the FileTabCharacter check is used with the default configuration,
          only the first instance of a tab character is reported.
        
Properties
| name | description | type | default value | since | 
|---|---|---|---|---|
| eachLine | Control whether to report on each line containing a tab, or just the first instance. | boolean | false | 
              
5.0 | 
| fileExtensions | Specify the file extensions of the files to process. | String[] | all files | 
              
5.0 | 
Examples
To configure the check to report only the first instance in each file:
<module name="Checker">
  <module name="FileTabCharacter"/>
</module>
Example - Test.java:
class Example1 {
  int a; // violation 'File contains tab characters'
  public void foo (int arg) { // ok, only first occurrence in file reported
    a = arg; // ok, indented using spaces
  }
}
To configure the check to report each instance in each file:
<module name="Checker">
  <module name="FileTabCharacter">
    <property name="eachLine" value="true"/>
  </module>
</module>
Example - Test.java:
class Example2 {
  int a; // violation 'contains a tab character'
  public void foo (int arg) { // violation 'contains a tab character'
    a = arg; // ok, indented using spaces
  }
}
To configure the check to report instances on only certain file types:
<module name="Checker">
  <module name="FileTabCharacter">
    <property name="fileExtensions" value="java, xml"/>
  </module>
</module>
Example - Test.java:
class Example3 {
  int a; // violation 'File contains tab characters'
  public void foo (int arg) { // ok, only first occurrence in file reported
    a = arg; // ok, indented using spaces
  }
}
Example - Test.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<UserAccount>
  <FirstName>John</FirstName> // violation 'File contains tab characters'
  <LastName>Doe</LastName>    <!-- OK, only first occurrence in file reported -->
</UserAccount>
Example - Test.html:
<head>
  <title>Page Title</title> <!-- OK, no check performed on html file extension -->
</head>                       <!-- not specified in check config -->
<body>
  <p>This is a simple html document.</p>
</body>
Example of Usage
Violation Messages
All messages can be customized if the default message doesn't suit you. Please see the documentation to learn how to.
Package
com.puppycrawl.tools.checkstyle.checks.whitespace






