Class DiffMessageFormatter


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

      Fields 
      Modifier and Type Field Description
      static int MAX_FILES_TO_LIST  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static DiffMessageFormatter.Builder builder()  
      static java.util.Map.Entry<java.lang.Integer,​java.lang.String> diff​(Formatter formatter, java.io.File file)
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • diff

        public static java.util.Map.Entry<java.lang.Integer,​java.lang.String> diff​(Formatter formatter,
                                                                                         java.io.File file)
                                                                                  throws java.io.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:
        java.io.IOException