Lib v3.0.0.BETA4
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. AFormatterStep
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
- throwing an exception during formatting, ideally
- 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
, andapplyToAndReturnResultIfDirty
fromFormatter
because users should instead useDirtyState
.
- BREAKING Removed
Fixed
ktlint
steps now read from thestring
instead of thefile
so they don't clobber earlier steps. (fixes #1599)