Class DiffMessageFormatter
- java.lang.Object
-
- com.diffplug.spotless.extra.integration.DiffMessageFormatter
-
public final class DiffMessageFormatter extends java.lang.ObjectFormats the messages of failed spotlessCheck invocations with a nice diff message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDiffMessageFormatter.Builder
-
Field Summary
Fields Modifier and Type Field Description static intMAX_FILES_TO_LIST
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DiffMessageFormatter.Builderbuilder()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.
-
-
-
Field Detail
-
MAX_FILES_TO_LIST
public static final int MAX_FILES_TO_LIST
- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static DiffMessageFormatter.Builder builder()
-
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
-
-