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

@Mojo(name="check", defaultPhase=VERIFY, threadSafe=true) public class Check extends AbstractFMT
Check mojo that will ensure all files are formatted. If some files are not formatted, an exception is thrown.
  • Field Details

    • displayFiles

      @Parameter(defaultValue="true", property="displayFiles") private boolean displayFiles
      Flag to display or not the files that are not compliant.
    • displayLimit

      @Parameter(defaultValue="100", property="displayLimit") private int displayLimit
      Limit the number of non-complying files to display
    • failOnError

      @Parameter(defaultValue="true", property="fmt.failOnError") private boolean failOnError
      Fail 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:
      postExecute in class AbstractFMT
      Parameters:
      result - The formatting result
      Throws:
      org.apache.maven.plugin.MojoFailureException - if there is an exception
    • shouldWriteReformattedFiles

      protected boolean shouldWriteReformattedFiles()
      Description copied from class: AbstractFMT
      Whether to write reformatted files to disk.
      Specified by:
      shouldWriteReformattedFiles in class AbstractFMT
    • getProcessingLabel

      protected String getProcessingLabel()
      Provides the name of the label used when a non-formatted file is found.
      Specified by:
      getProcessingLabel in class AbstractFMT
      Returns:
      the label to use in the log