src/main/java/com/spotify/fmt/Check.java
@Override
  protected void postExecute(FormattingResult result) throws MojoFailureException {
    if (!result.nonComplyingFiles().isEmpty()) {
      String message =
          "Found " + result.nonComplyingFiles().size() + " non-complying files, failing build";
      getLog().error(message);
      getLog()
          .error("To fix formatting errors, run \"mvn com.spotify.fmt:fmt-maven-plugin:format\"");
      // do not support limit < 1
      displayLimit = max(1, displayLimit);

      // Display first displayLimit files not formatted
      if (displayFiles) {
        result.nonComplyingFiles().stream()
            .limit(displayLimit)
            .forEach(path -> getLog().error("Non complying file: " + path));

        if (result.nonComplyingFiles().size() > displayLimit) {
          getLog()
              .error(
                  format(
                      "... and %d more files.", result.nonComplyingFiles().size() - displayLimit));
        }
      }
      throw new MojoFailureException(message);
    }
  }
/**
   * Post Execute action. It is called at the end of the execute method. Subclasses can add extra
   * checks.
   *
   * @param result The formatting result
   * @throws MojoFailureException if there is an exception
   */
Post Execute action. It is called at the end of the execute method. Subclasses can add extra
checks.

@param result The formatting result
@throws MojoFailureException if there is an exception
Post Execute action . It is called at the end of the execute method . Subclasses can add extra checks . @param result The formatting result @throws MojoFailureException if there is an exception
@Override
  protected void postExecute(FormattingResult result) throws MojoFailureException {
    if (!result.nonComplyingFiles().isEmpty()) {
      String message =
          "Found " + result.nonComplyingFiles().size() + " non-complying files, failing build";
      getLog().error(message);
      getLog()
          .error("To fix formatting errors, run \"mvn com.spotify.fmt:fmt-maven-plugin:format\"");
      displayLimit = max(1, displayLimit);
      if (displayFiles) {
        result.nonComplyingFiles().stream()
            .limit(displayLimit)
            .forEach(path -> getLog().error("Non complying file: " + path));
        if (result.nonComplyingFiles().size() > displayLimit) {
          getLog()
              .error(
                  format(
                      "... and %d more files.", result.nonComplyingFiles().size() - displayLimit));
        }
      }
      throw new MojoFailureException(message);
    }
  }
@ Override protected void postExecute ( FormattingResult result ) throws MojoFailureException { if ( ! result . nonComplyingFiles ( ) . isEmpty ( ) ) { String message = "Found " + result . nonComplyingFiles ( ) . size ( ) + " non-complying files, failing build" ; getLog ( ) . error ( message ) ; getLog ( ) . error ( "To fix formatting errors, run \"mvn com.spotify.fmt:fmt-maven-plugin:format\"" ) ; displayLimit = max ( 1 , displayLimit ) ; if ( displayFiles ) { result . nonComplyingFiles ( ) . stream ( ) . limit ( displayLimit ) . forEach ( path -> getLog ( ) . error ( "Non complying file: " + path ) ) ; if ( result . nonComplyingFiles ( ) . size ( ) > displayLimit ) { getLog ( ) . error ( format ( "... and %d more files." , result . nonComplyingFiles ( ) . size ( ) - displayLimit ) ) ; } } throw new MojoFailureException ( message ) ; } }
Post Execute action.
Post Execute action .
// do not support limit < 1 // Display first displayLimit files not formatted