public class FileTabCharacterCheck extends AbstractFileSetCheck
Checks that there are no tab characters ('\t'
) in the source code.
Rationale:
eachLine
- Control whether to report on each line containing a tab,
or just the first instance.
Type is boolean
.
Default value is false
.
fileExtensions
- Specify file type extension of files to process.
Type is java.lang.String[]
.
Default value is all files
.
To configure the check to report on the first instance in each file:
<module name="FileTabCharacter"/>
To configure the check to report on each line in each file:
<module name="FileTabCharacter"> <property name="eachLine" value="true"/> </module>
Parent is com.puppycrawl.tools.checkstyle.Checker
Violation Message Keys:
containsTab
file.containsTab
AutomaticBean.OutputStreamOptions
Modifier and Type | Field and Description |
---|---|
static String |
MSG_CONTAINS_TAB
A key is pointing to the warning message text in "messages.properties"
file.
|
static String |
MSG_FILE_CONTAINS_TAB
A key is pointing to the warning message text in "messages.properties"
file.
|
Constructor and Description |
---|
FileTabCharacterCheck() |
Modifier and Type | Method and Description |
---|---|
protected void |
processFiltered(File file,
FileText fileText)
Called to process a file that matches the specified file extensions.
|
void |
setEachLine(boolean eachLine)
Setter to control whether to report on each line containing a tab, or just the first
instance.
|
addMessages, beginProcessing, destroy, finishProcessing, fireErrors, getFileContents, getFileExtensions, getMessageDispatcher, getMessages, getTabWidth, init, log, log, process, setFileContents, setFileExtensions, setMessageDispatcher, setTabWidth
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
configure, contextualize, getConfiguration, setupChild
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure
contextualize
public static final String MSG_CONTAINS_TAB
public static final String MSG_FILE_CONTAINS_TAB
public FileTabCharacterCheck()
protected void processFiltered(File file, FileText fileText)
AbstractFileSetCheck
processFiltered
in class AbstractFileSetCheck
file
- the file to be processedfileText
- the contents of the file.public void setEachLine(boolean eachLine)
eachLine
- Whether report on each line containing a tab.Copyright © 2001–2020. All rights reserved.