Class DiffMessageFormatter

java.lang.Object
com.diffplug.spotless.extra.integration.DiffMessageFormatter

public final class DiffMessageFormatter extends Object
Formats the messages of failed spotlessCheck invocations with a nice diff message.
  • Field Details

  • Method Details

    • builder

      public static DiffMessageFormatter.Builder builder()
    • diff

      public static Map.Entry<Integer,String> diff(Path rootDir, Formatter formatter, File file) throws IOException
      Returns a map entry with value being a git-style diff between the contents of the given file and what those contents would look like if formatted using the given formatter. Does not end with any newline sequence (\n, \r, \r\n). The key of the map entry is the 0-based line where the first difference occurred.
      Throws:
      IOException