Skip to content

Lib v3.0.0.BETA4

Compare
Choose a tag to compare
@github-actions github-actions released this 24 Oct 15:31
· 79 commits to main since this release

Added

  • APIs to support linting. (implemented in #2148, #2149, #2307)
    • Spotless is still primarily a formatter, not a linter. But when formatting fails, it's more flexible to model those failures as lints so that the formatting can continue and ideally we can also capture the line numbers causing the failure.
    • Lint models a single change. A FormatterStep can create a lint by:
      • throwing an exception during formatting, ideally throw Lint.atLine(127, "code", "Well what happened was...")
      • or by implementing the List<Lint> lint(String content, File file) method to create multiple of them
  • Support for line ending policy PRESERVE which just takes the first line ending of every given file as setting (no matter if \n, \r\n or \r) (#2304)

Changes

  • BREAKING Moved PaddedCell.DirtyState to its own top-level class with new methods. (#2148)
    • BREAKING Removed isClean, applyTo, and applyToAndReturnResultIfDirty from Formatter because users should instead use DirtyState.

Fixed

  • ktlint steps now read from the string instead of the file so they don't clobber earlier steps. (fixes #1599)