Package com.spotify.fmt
Class Check
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.spotify.fmt.AbstractFMT
com.spotify.fmt.Check
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
Check mojo that will ensure all files are formatted. If some files are not formatted, an
exception is thrown.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanFlag to display or not the files that are not compliant.private intLimit the number of non-complying files to displayprivate booleanFail build for non-compliant formattingFields inherited from class com.spotify.fmt.AbstractFMT
useDefaultClasspathWhenForkingFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringProvides the name of the label used when a non-formatted file is found.protected voidpostExecute(FormattingResult result) Post Execute action.protected booleanWhether to write reformatted files to disk.Methods inherited from class com.spotify.fmt.AbstractFMT
execute, getResult, shouldForkMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
displayFiles
@Parameter(defaultValue="true", property="displayFiles") private boolean displayFilesFlag to display or not the files that are not compliant. -
displayLimit
@Parameter(defaultValue="100", property="displayLimit") private int displayLimitLimit the number of non-complying files to display -
failOnError
@Parameter(defaultValue="true", property="fmt.failOnError") private boolean failOnErrorFail build for non-compliant formatting
-
-
Constructor Details
-
Check
public Check()
-
-
Method Details
-
postExecute
protected void postExecute(FormattingResult result) throws org.apache.maven.plugin.MojoFailureException Post Execute action. It is called at the end of the execute method. Subclasses can add extra checks.- Overrides:
postExecutein classAbstractFMT- Parameters:
result- The formatting result- Throws:
org.apache.maven.plugin.MojoFailureException- if there is an exception
-
shouldWriteReformattedFiles
protected boolean shouldWriteReformattedFiles()Description copied from class:AbstractFMTWhether to write reformatted files to disk.- Specified by:
shouldWriteReformattedFilesin classAbstractFMT
-
getProcessingLabel
Provides the name of the label used when a non-formatted file is found.- Specified by:
getProcessingLabelin classAbstractFMT- Returns:
- the label to use in the log
-