Skip to content

Latest commit

 

History

History
310 lines (249 loc) · 24.9 KB

CHANGES.md

File metadata and controls

310 lines (249 loc) · 24.9 KB

spotless-lib and spotless-lib-extra releases

If you are a Spotless user (as opposed to developer), then you are probably looking for:

This document is intended for Spotless developers.

We adhere to the keepachangelog format (starting after version 1.27.0).

[Unreleased]

  • Bump default ktfmt from 0.15 to 0.16, and remove duplicated logic for the --dropbox-style option (#642)

[2.2.0] - 2020-07-13

Added

  • Bump default ktfmt from 0.13 to 0.15, and add support for the --dropbox-style option (#641).

[2.1.0] - 2020-07-04

Added

  • FileSignature.machineIsWin(), to replace the now-deprecated LineEnding.nativeIsWin(), because it turns out that \r\n is not a reliable way to detect the windows OS (#639).

Fixed

  • GitAttributesLineEndings was fatally broken (always returned platform default), and our tests missed it because they tested the part before the broken part (#639).

[2.0.0] - 2020-07-02

Changed

  • LineEnding.GIT_ATTRIBUTES now creates a policy whose serialized state can be relocated from one machine to another. No user-visible change, but paves the way for remote build cache support in Gradle. (#621)

Added

  • prettier will now autodetect the parser (and formatter) to use based on the filename, unless you override this using config or configFile with the option parser or filepath. (#620)
  • GitRatchet now lives in lib-extra, and is shared across plugin-gradle and plugin-maven (#626).
  • Added ANTLR4 support (#326).
  • FormatterFunc.NeedsFile for implementing file-based formatters more cleanly than we have so far (#637).

Changed

  • BREAKING FileSignature can no longer sign folders, only files. Signatures are now based only on filename (not path), size, and a content hash. It throws an error if a signature is attempted on a folder or on multiple files with different paths but the same filename - it never breaks silently. This change does not break any of Spotless' internal logic, so it is unlikely to affect any of Spotless' consumers either. (#571)
    • This change allows the maven plugin to cache classloaders across subprojects when loading config resources from the classpath (fixes #559).
    • This change also allows the gradle plugin to work with the remote buildcache (fixes #280).
  • BREAKING FormatterFunc no longer extends ThrowingEx.Function and BiFunction. In a major win for Java's idea of "target typing", this required no changes anywhere in the codebase except deleting the extends part of FormatterFunc (#638).
  • BREAKING Heavy refactor of the LicenseHeaderStep public API. Doesn't change internal behavior, but makes implementation of the gradle and maven plugins much easier. (#628)
  • BREAKING Removed all deprecated methods and classes from lib and lib-extra.
    • #629 removes the code which wasn't being used in plugin-gradle or plugin-maven.
    • #630 moves the code which was still being used in deprecated parts of plugin-gradle into .deprecated package in plugin-gradle, which allows us to break lib without a breaking change in plugin-gradle.

[1.34.1] - 2020-06-17

Changed

  • Nodejs-based formatters prettier and tsfmt now use native node instead of the J2V8 approach. (#606)
    • This removes the dependency to the no-longer-maintained Linux/Windows/macOs variants of J2V8.
    • This enables spotless to use the latest prettier versions (instead of being stuck at prettier version <= 1.19.0)
    • Bumped default versions, prettier 1.16.4 -> 2.0.5, tslint 5.12.1 -> 6.1.2
  • Our main branch is now called main. (#613)

[1.34.0] - 2020-06-05

Added

  • LicenseHeaderStep.setLicenseHeaderYearsFromGitHistory, which does an expensive search through git history to determine the oldest and newest commits for each file, and uses that to determine license header years. (#604)

[1.33.1] - 2020-06-04

  • We are now running CI on windows. (#596)
  • We are now dogfooding ratchetFrom and licenseHeader with a $YEAR token to ensure that Spotless copyright headers stay up-to-date without adding noise to file history. (#595)
  • Added LineEnding.nativeIsWin(), FileSignature.pathNativeToUnix(), and FileSignature.pathUnixToNative(), along with many API-invisible fixes and cleanup. (#592)

[1.33.0] - 2020-06-03

Added

  • LicenseHeaderStep now has an updateYearWithLatest parameter which can update copyright headers to today's date. (#593)
    • Parsing of existing years from headers is now more lenient.
    • The LicenseHeaderStep constructor is now public, which allows capturing its state lazily, which is helpful for setting defaults based on ratchetFrom.

[1.32.0] - 2020-06-01

Added

  • NodeJsGlobal.setSharedLibFolder allows to set the location of nodejs shared libs. (#586)
  • PaddedCell.isClean() returns the instance of PaddedCell.DirtyState which represents clean. (#590)

Fixed

  • Previously, the nodejs-based steps would throw UnsatisfiedLinkError if they were ever used from more than one classloader. Now they can be used from any number of classloaders (important for gradle build daemon). (#586)

[1.31.0] - 2020-05-21

Added

  • PaddedCell.calculateDirtyState is now defensive about misconfigured character encoding. (#575)

[1.30.1] - 2020-05-17

Fixed

  • PaddedCell.DirtyState::writeCanonicalTo(File) can now create a new file if necessary (previously required to overwrite an existing file) (#576).

[1.30.0] - 2020-05-11

Added

  • PaddedCell.calculateDirtyState(Formatter, File, byte[]) to allow IDE integrations to send dirty editor buffers.

[1.29.0] - 2020-05-05

Added

  • Support for google-java-format 1.8 (including test infrastructure for Java 11). (#562)
  • Improved PaddedCell such that it is as performant as non-padded cell - no reason not to have it always enabled. Deprecated all of PaddedCellBulk. (#561)
  • Support for ktfmt 0.13 (#569)

Changed

  • Updated a bunch of dependencies, most notably: (#564)
    • jgit 5.5.0.201909110433-r -> 5.7.0.202003110725-r
    • gradle 6.2.2 -> 6.3
    • spotbugs gradle plugin 2.0.0 -> 4.0.8

[1.28.1] - 2020-04-02

Fixed

  • Javadoc for the ext/eclipse-* projects.
  • Replace the deprecated compile with implementation for the ext/eclipse-* projects.

[1.28.0] - 2020-03-20

Added

  • Enable IntelliJ-compatible token $today.year for specifying the year in license header files. (#542)

Fixed

  • Eclipse-WTP formatter (web tools platform, not java) could encounter errors in parallel multiproject builds #492. Fixed for Eclipse-WTP formatter Eclipse version 4.13.0 (default version).

Build

  • All CHANGES.md are now in keepachangelog format. (#507)
  • We now use javadoc.io instead of github pages. (#508)
  • We no longer publish -SNAPSHOT for every build to main, since we have good JitPack integration. (#508)
  • Improved how we use Spotless on itself. (#509)
  • Fix build warnings when building on Gradle 6+, bump build gradle to 6.2.2, and fix javadoc links. (#536)

[1.27.0] - 2020-01-01

  • Ignored KtLintStepTest, because gradle/gradle#11752 is causing too many CI failures. (#499)
    • Also fixed a minor problem in TestProvisioner.
  • If you set the environment variable SPOTLESS_EXCLUDE_MAVEN=true then the maven plugin will be excluded from the build. (#502)
  • Deprecated SpotlessCache.clear() in favor of the new SpotlessCache.clearOnce(Object key). (#501)

[1.26.1] - 2019-11-27

  • Revert the change in console display of errors from 1.26.0 (#485) because of these problems.
  • Bugfix: Fix NPE in EclipseXmlFormatterStepImpl (#489)

[1.26.0] - 2019-11-11

  • Fix project URLs in poms. (#478)
  • Fix ImportSorter crashing with empty files. (#474)
    • Fixes #305 StringIndexOutOfBoundsException for empty Groovy file when performing importOrder
  • Bugfix: CDT version 4.12.0 now properly uses 9.8, whereas before it used 9.7. (#482)
  • Add support for Eclipse 4.13 and all related formatters (JDT, CDT, WTP, and Groovy). (#480)
  • Bump default version of KtLint from 0.34.2 to 0.35.0. (#473)
  • Several improvements to the console display of formatting errors. (#465)
    • Visualize \r and \n as ␍ and ␊ when possible (#465)
    • Make end-of-lines visible when file contains whitespace and end-of-line issues at the same time (#465)
    • Print actual diff line instead of "1 more lines that didn't fit" (#467)
  • Automatically configure import order for IntelliJ IDEA with .editorconfig (#486)

[1.25.0] - 2019-10-06

  • Add support for ktlint 0.34+, and bump default version from 0.32.0 to 0.34.2. (#469)

[1.24.3] - 2019-09-23

  • Update jgit from 5.3.2.201906051522-r to 5.5.0.201909110433-r. (#445)
  • Eclipse-based formatters used to leave temporary files around (#447). This is now fixed, but only for eclipse 4.12+, no back-port to older Eclipse formatter versions is planned. (#451)
  • PaddedCellBulk had a bug where badly-formatted files with well-behaving formatters were being:
    • correctly formatted by "apply"
    • but incorrectly marked as good by "check"
    • this led to "check" says all good, but then "apply" still causes format (#453)
    • combined with up-to-date checking, could lead to even more confusing results (#338)
    • only affects the gradle plugin, since that was the only plugin to use this feature
  • Minor change to TestProvisioner, which should fix the cache-breaking issues, allowing us to speed-up the CI builds a bit.
  • Bumped scalafmt default version from 1.1.0 to 2.0.1, since there are bugs in the old default (#458).

[1.24.1] - 2019-08-12

  • Fixes class loading issue with Java 9+ (#426).

[1.24.0] - 2019-07-29

  • Updated default eclipse-wtp from 4.8.0 to 4.12.0 (#423).
  • Updated default eclipse-groovy from 4.10 to 4.12.0 (#423).
  • Updated default eclipse-jdt from 4.11.0 to 4.12.0 (#423).
  • Updated default eclipse-cdt from 4.11.0 to 4.12.0 (#423).
    • KNOWN BUG - accidentally published CDT 9.7 rather than 9.8 - fixed in 1.26.0
  • Added new maven coordinates for scalafmt 2.0.0+, maintains backwards compatability (#415)

[1.23.1] - 2019-06-17

  • Fixes incorrect M2 cache directory path handling of Eclipse based formatters (#401)
  • Update jgit from 4.9.0.201710071750-r to 5.3.2.201906051522-r because gradle project is sometimes broken by apache httpcomponents in transitive dependency. (#407)

[1.23.0] - 2019-04-24

  • Updated default ktlint from 0.21.0 to 0.32.0, and Maven coords to com.pinterest (#394)

[1.22.0] - 2019-04-15

  • Updated default eclipse-cdt from 4.7.3a to 4.11.0 (#390).

[1.21.1] - 2019-03-29

  • Fixes incorrect plugin and pom metadata in 1.21.0 (#388).

[1.21.0] - 2019-03-28

  • We now use a remote build cache to speed up CI builds. Reduced build time from ~13 minutes to as low as ~3 minutes, dependending on how deep the change is (#380).
  • Updated default eclipse-wtp from 4.7.3b to 4.8.0 (#382).
  • Updated default eclipse-groovy from 4.8.1 to 4.10.0 (#382).
  • Updated default eclipse-jdt from 4.10.0 to 4.11.0 (#384).

[1.20.0] - 2019-03-11

  • Made npm package versions of prettier and tsfmt (and its internal packages) configurable. (#363)
    • Updated default npm package version of prettier from 1.13.4 to 1.16.4
    • Updated default npm package version of internally used typescript package from 2.9.2 to 3.3.3 and tslint package from 5.1.0 to 5.12.0 (both used by tsfmt)
  • Updated default eclipse-wtp from 4.7.3a to 4.7.3b (#371).
  • Configured build-scan plugin in build (#356).
    • Runs on every CI build automatically.
    • Users need to opt-in on their local machine.
  • Default behavior of XML formatter changed to ignore external URIs (#369).
    • WARNING RESOLVED: By default, xml formatter no longer downloads external entities. You can opt-in to resolve external entities by setting resolveExternalURI to true. However, if you do opt-in, be sure that all external entities are referenced over https and not http, or you may be vulnerable to XXE attacks.

[1.19.0] - 2019-03-11

WARNING: xml formatter in this version may be vulnerable to XXE attacks, fixed in 1.20.0 (see #358).

  • Security fix: Updated groovy, c/c++, and eclipse WTP formatters so that they download their source jars securely using https rather than http (#360).
  • Updated default eclipse-jdt from 4.9.0 to 4.10.0 (#368)

[1.18.0] - 2019-02-11

WARNING: xml formatter in this version may be vulnerable to XXE attacks, fixed in 1.20.0 (see #358).

  • CSS and XML extensions are discontinued (#325).
  • Provided features with access to SLF4J interface of build tools. (#236)
  • Updated default google-java-format from 1.5 to 1.7 (#335).
  • ImportOrderStep.createFromFile is now lazy (#218).

[1.17.0] - 2018-10-30

WARNING: xml formatter in this version may be vulnerable to XXE attacks, fixed in 1.20.0 (see #358).

  • Updated default eclipse-jdt from 4.7.3a to 4.9.0 (#316). New version addresses enum-tab formatting bug in 4.8 (#314).

[1.16.0] - 2018-10-30

WARNING: xml formatter in this version may be vulnerable to XXE attacks, fixed in 1.20.0 (see #358).

  • Minor support for plugin-gradle and plugin-maven CSS plugins (#311).

[1.15.0] - 2018-09-23

WARNING: xml formatter in this version may be vulnerable to XXE attacks, fixed in 1.20.0 (see #358).

  • Added C/C++ support (#232).
  • Integrated Eclipse CDT formatter (#274)
  • Extended dependency provisioner to exclude transitives on request (#297).This prevents unnecessary downloads of unused transitive dependencies for Eclipse based formatter steps.
  • Updated default groovy-eclipse from 4.8.0 to 4.8.1 (#288). New version is based on Groovy-Eclipse 3.0.0.
  • Integrated Eclipse WTP formatter (#290)
  • Updated JSR305 annotation from 3.0.0 to 3.0.2 (#274)
  • Migrated from FindBugs annotations 3.0.0 to SpotBugs annotations 3.1.6 (#274)
  • Formatter now implements AutoCloseable. This means that users of Formatter are expected to use the try-with-resources pattern. The reason for this change is so that FormatterFunc.Closeable actually works. (#284)* Added prettier and tsfmt support, as well as general infrastructure for calling nodeJS code using j2v8 (#283).

[1.14.0] - 2018-07-24

  • Updated default groovy-eclipse from 4.6.3 to 4.8.0 (#244). New version allows to ignore internal formatter errors/warnings.
  • Updated default eclipse-jdt from 4.7.2 to 4.8.0 (#239). New version fixes a bug preventing Java code formatting within JavaDoc comments (#191).
  • Eclipse formatter versions decoupled from Spotless formatter step implementations to allow independent updates of maven-based Eclipse dependencies. (#253)
  • Use guaranteed binary and source compatibility between releases of Scalafmt. (#260)

[1.13.0] - 2018-06-01

  • Add line and column numbers to ktlint errors. (#251)

[1.12.0] - 2018-05-14

  • Fixed a bug in LicenseHeaderStep which caused an exception with some malformed date-aware licenses. (#222)
  • Updated default ktlint from 0.14.0 to 0.21.0
  • Add ability to pass custom options to ktlint in gradle plugin. See plugin-gradle/README for details.

[1.11.0] - 2018-02-26

  • Added default indentation of 4 to IndentStep. (#209)

[1.10.0] - 2018-02-15

  • LicenseHeaderStep now supports customizing the year range separator in copyright notices. (#199)
  • Breaking change to testlib - removed ResourceHarness.write and added ResourceHarness.[set/assert]File for easier-to-read tests. (#203)

[1.9.0] - 2018-02-05

  • Updated default ktlint from 0.6.1 to 0.14.0
  • Updated default google-java-format from 1.3 to 1.5
  • Updated default eclipse-jdt from 4.7.1 to 4.7.2
  • Added a configuration option to googleJavaFormat to switch the formatter style (#193)

[1.8.0] - 2018-01-02

  • LicenseHeaderStep now supports time-aware copyright notices in license headers. (#179, thanks to @baptistemesta)

[1.7.0] - 2018-12-02

  • Updated default eclipse-jdt version to 4.7.1 from 4.6.3.
  • Updated jgit from 4.5.0.201609210915-r to 4.9.0.201710071750-r.
  • Updated concurrent-trees from 2.6.0 to 2.6.1 (performance improvement).
  • Added dbeaverSql formatter step, for formatting sql scripts. (#166)

[1.6.0] - 2017-09-29

  • Added public static boolean PaddedCell::applyAnyChanged(Formatter formatter, File file).

[1.5.1] - 2017-08-14

  • Added KtLintStep.createForScript.

[1.5.0] - 2017-08-13

  • Deprecated ImportOrderStep.createFromOrder(List<String> in favor of (String....

[1.4.1] - 2017-07-11

  • Default eclipse version for EclipseFormatterStep bumped to 4.6.3 from 4.6.1. (#116)
  • Default scalafmt version for ScalaFmtStep bumped to 1.1.0 from 0.5.7 (#124)
    • Also added support for the API change to scalafmt introduced in 0.7.0-RC1

[1.4.0] - 2017-05-21

  • ImportOrderStep can now handle multi-line comments and misplaced imports.
    • Especially helpful for Groovy and Gradle files.

[1.3.2] - 2017-05-03

  • Fixed a bug in PaddedCellBulk.check() which caused a check to fail even after an apply for cases which caused CYCLE.

[1.3.0] - 2017-04-11

  • Added support for Groovy via greclipse.
  • When a JarState resolution failed, it threw a Gradle-specific error message. That message has been moved out of lib and into plugin-gradle where it belongs.

[1.2.0] - 2017-04-03

  • Deprecated FileSignature.from in favor of FileSignature.signAsSet and the new FileSignature.signAsList.
  • Added a FormatterProperties class which loads .properties files and eclipse-style .xml files.
  • SerializableFileFilter.skipFilesNamed can now skip multiple file names.
  • Update default KtLint from 0.3.1 to 0.6.1.
    • This means we no longer look for rules in the typo package com.gihub.shyiko, now only in com.github.shyiko (note the t).

[1.1.0] - 2017-02-27

  • Added support for Scala via scalafmt.
  • Added support for Kotlin via ktlint.
  • Better error messages for JarState.
  • Improved test harnessing.
  • Formatter now has pluggable exception policies,

[1.0.0] - 2017-01-09

  • Initial release!