We adhere to the keepachangelog format (starting after version 3.27.0).
- Support custom rule sets for Ktlint. (#1896
- Fix Eclipse JDT on some settings files. (#1864 fixes #1638)
- Check if EditorConfig file exist for Ktlint in KotlinGradleExtension. (#1889)
- Bump default
ktlintversion to latest1.0.0->1.0.1. (#1855)
- Fix
GoogleJavaFormatConfig.reorderImportsnot working. (#1872)
- Added support for
google-java-format'sskip-javadoc-formattingoption (#1793) - Add support for
flexmarkin gradle. Previously only Maven was supported. (#1801) - Add support for biome. The Rome project was renamed to Biome.
The configuration is still the same, but you should switch to the new
biome(...)function and adjust the version accordingly. (#1804).
- Fixed support for plugins when using Prettier version
3.0.0and newer. (#1802)
- Bump default
ktlintversion to latest0.50.0->1.0.0. (#1808) - POSSIBLY BREAKING the default line endings are now
GIT_ATTRIBUTES_FAST_ALLSAMEinstead ofGIT_ATTRIBUTES. (#1838)- If all the files within a format have the same line endings, then there is no change in behavior.
- Fixes large performance regression. (#1527)
- Add a
jsonPatchstep tojsonformatter configurations. This allows patching of JSON documents using JSON Patches. (#1753) - Support GJF own import order. (#1780)
- Add support for
prettierversion3.0.0and newer. (#1760, #1751) - Fix npm install calls when npm cache is not up-to-date. (#1760, #1750)
- Fix configuration cache failure when using LineEnding.GIT_ATTRIBUTES (#1644)
- Fix configuration cache failure when formatting proto files with Buf. (#1779)
- Check if EditorConfig file exist for Ktlint. (#1788)
- Bump default
eslintversion to latest8.31.0->8.45.0(#1761) - Bump default
prettierversion to latest (v2)2.8.1->2.8.8. (#1760) - Bump default
greclipseversion to latest4.27->4.28. (#1775)
- Add target option
targetExcludeIfContentContainsandtargetExcludeIfContentContainsRegexto exclude files based on their text content. (#1749) - Add support for Protobuf formatting based on Buf (#1208).
- Add an overload for
FormatExtension.addStepwhich provides access to theFormatExtension'sProvisioner, enabling custom steps to make use of third-party dependencies.
- Correctly support the syntax
spotless { yaml { jackson().yamlFeature("MINIMIZE_QUOTES", true) } }
- Bump default
cleanthatversion to latest2.13->2.17. (#1734) - Bump default
ktlintversion to latest0.49.1->0.50.0. (#1741)- Dropped support for
ktlint 0.47.xfollowing our policy of supporting two breaking changes at a time. - Dropped support for deprecated
useExperimentalparameter in favor of thektlint_experimentalproperty.
- Dropped support for
- Support Rome as a formatter for JavaScript and TypeScript code. Adds a new
romestep tojavascriptandtypescriptformatter configurations. (#1663) - Add semantics-aware Java import ordering (i.e. sort by package, then class, then member). (#522)
- Added
@DisableCachingByDefaulttoRegisterDependenciesTask. (#1666) - Fixed a regression which changed the import sorting order in
googleJavaFormatintroduced in6.18.0. (#1680) - Equo-based formatters now work on platforms unsupported by Eclipse such as PowerPC (fixes durian-swt#20)
- When P2 download fails, indicate the responsible formatter. (#1698)
- Equo-based formatters now download metadata to
~/.m2/repository/dev/equo/p2-datarather than~/.equo, and for CI machines without a home directory the p2 data goes to$GRADLE_USER_HOME/caches/p2-data. (#1714) - Bump default
googleJavaFormatversion to latest1.16.0->1.17.0. (#1710) - Bump default
ktfmtversion to latest0.43->0.44. (#1691) - Bump default
ktlintversion to latest0.48.2->0.49.1. (#1696)- Dropped support for
ktlint 0.46.xfollowing our policy of supporting two breaking changes at a time.
- Dropped support for
- Bump default
sortpomversion to latest3.0.0->3.2.1. (#1675)
removeUnusedImportcan be configured to rely oncleanthat-javaparser-unnecessaryimport. Default remainsgoogle-java-format. (#1589)- Added formatter for Gherkin feature files (#1649).
- Support configuration of mirrors for P2 repositories (#1629):
Mirrors are selected by prefix match, for example
spotless { java { eclipse().withP2Mirrors(['https://download.eclipse.org/', 'https://some.internal.mirror/eclipse']) } }https://download.eclipse.org/eclipse/updates/4.26/will be redirected tohttps://some.internal.mirror/eclipse/eclipse/updates/4.26/. The same configuration exists forgreclipseandeclipseCdt. - The
styleoption in Palantir Java Format (#1654).
- Stop using deprecated conventions when used in Gradle >=
7.1. (#1618)
- POTENTIALLY BREAKING Drop support for
googleJavaFormatversions <1.8. (#1630) - Bump default
cleanthatversion to latest2.6->2.13. (#1589 and #1661) - Bump default
diktatversion1.2.4.2->1.2.5. (#1631) - Bump default
flexmarkversion0.62.2->0.64.0. (#1302) - Bump default
googleJavaFormatversion1.15.0->1.16.0. (#1630) - Bump default
scalafmtversion3.7.1->3.7.3. (#1584) - Bump default Eclipse formatters for the 2023-03 release. (#1662)
- JDT and GrEclipse
4.26->4.27- Improve GrEclipse error reporting. (#1660)
- CDT
11.0->11.1
- JDT and GrEclipse
- You can now put the filename into a license header template with
$FILE. (#1605 fixes #1147) licenseHeaderdefault pattern for Java files is updated to(package|import|public|class|module). (#1614)
- All Eclipse formatters are now based on Equo Solstice OSGi and p2 shim. (#1524)
- Eclipse JDT bumped default to
4.26from4.21, oldest supported is4.9.- We now recommend dropping the last
.0, e.g.4.26instead of4.26.0, you'll get warnings to help you switch.
- We now recommend dropping the last
- Eclipse Groovy bumped default to
4.26from4.21, oldest supported is4.18. - Eclipse CDT bumped default to
11.0from4.21, oldest supported is10.6. - Eclipse WTP is still WIP at #1622.
- Eclipse JDT bumped default to
cleanthatnow hasincludeDraftoption, to include draft mutators from composite mutators. (#1574)npm-based formatters (prettier,tsfmtandeslint) now support caching ofnode_modulesdirectory. To enable it, providenpmInstallCache()option. (#1590)
json { jackson()can now handleArrayas a root element. (#1585)- Reduce logging-noise created by
npm-based formatters (#1590 fixes #1582)
- CleanThat Java Refactorer. (#1560)
- Allow multiple instances of the same npm-based formatter to be used simultaneously. E.g. use prettier for typescript
and Java (using the community prettier-plugin-java) without messing up their respective
node_moduledependencies. (#1565) ktfmtdefault style uses correct continuation indent. (#1562)
- Bump default
ktfmtversion to latest0.42->0.43(#1561) - Bump default
jacksonversion to latest2.14.1->2.14.2(#1536)
freshmarkfixed on java 15+ (#1304 fixes #803)- POTENTIALLY BREAKING
sortByKeysfor JSON formatting now takes into account objects inside arrays (#1546)
- Support
jackson()for YAML and JSON files (#1492) - Prettier will now suggest to install plugins if a parser cannot be inferred from the file extension (#1511)
- Allow to specify node executable for node-based formatters using
nodeExecutableparameter (#1500)
- POTENTIALLY BREAKING Generate the correct qualifiedRuleId for Ktlint 0.48.x #1495
- The default list of type annotations used by
formatAnnotationshas had 8 more annotations from the Checker Framework added #1494
- POTENTIALLY BREAKING Bump minimum JRE from 8 to 11 (#1514 part 1 of #1337)
- You can bump your build JRE without bumping your requirements (docs).
- Prettier will now suggest to install plugins if a parser cannot be inferred from the file extension (#1511)
- POTENTIALLY BREAKING Removed support for KtLint 0.3x and 0.45.2 (#1475)
KtLintdoes not maintain a stable API - before this PR, we supported every breaking change in the API since 2019.- From now on, we will support no more than 2 breaking changes at a time.
npm-based formattersESLint,prettierandtsfmtdelay theirnpm installcall until the formatters are first used. For Gradle this effectively moves thenpm installcall out of the configuration phase and as such enables better integration withgradle-node-plugin. (#1522)- Bump default
ktlintversion to latest0.48.1->0.48.2(#1529) - Bump default
scalafmtversion to latest3.6.1->3.7.1(#1529)
- POTENTIALLY BREAKING
ktlintstep now supports.editorconfig(#1442 implements #142)- POTENTIALLY BREAKING
ktlintstep now modifies license headers. Make sure to putlicenseHeaderafterktlint.
- POTENTIALLY BREAKING
- Added
skipLinesMatchingoption tolicenseHeaderto support formats where license header cannot be immediately added to the top of the file (e.g. xml, sh). (#1441) - Added support for npm-based ESLint formatter for javascript and typescript (#1453)
- Better suggested messages when user's default is set by JVM limitation. (#995)
- Prevent tool configurations from being resolved outside project (#1447 fixes #1215)
- Support
ktlint0.48+ new rule disabling syntax (#1456) fixes (#1444) - Fix subgroups leading catch all matcher.
- Bump default
ktlintversion to latest0.47.1->0.48.1(#1456) - Bump default version for
prettierfrom2.0.5to2.8.1(#1453)
- Bump default
ktlintversion to latest0.47.1->0.48.0(#1432) - Bump default
ktfmtversion to latest0.41->0.42(#1421)
importOrdernow support groups of imports without blank lines (#1401)
- Bump default
ktfmtversion to latest0.40->0.41(#1340) - Bump default
scalafmtversion to latest3.5.9->3.6.1(#1373) - Bump default
diktatversion to latest1.2.3->1.2.4.2(#1393) - Bump default
palantir-java-formatversion to latest2.10->2.28(#1393)
formatAnnotations()step to correct formatting of Java type annotations. It puts type annotations on the same line as the type that they qualify. Run it after a Java formatting step, such asgoogleJavaFormat(). (#1275)
- Bump default
ktfmtversion to latest0.39->0.40(#1312) - Bump default
ktlintversion to latest0.46.1->0.47.1(#1303)- Also restored support for older versions of ktlint back to
0.31.0
- Also restored support for older versions of ktlint back to
scalafmtintegration now has a configuration optionmajorScalaVersionthat allows you to configure the Scala version that gets resolved from the Maven artifact (#1283)
- Add the
ktlintrule in error messages whenktlintfails to apply a fix (#1279) - Bump default
scalafmtto latest3.0.8->3.5.9(removed support for pre-3.0.0) (#1283)
- Bump default
diktatversion to latest1.2.1->1.2.3(#1266)
- Clang and Black no longer break the build when the binary is unavailable, if they will not be run during that build (#1257).
- License header support for Kotlin files without
packageor@filebut do at least haveimport(#1263).
- Bump default
ktlintversion to latest0.45.2->0.46.1(#1239)- Minimum supported version also bumped to
0.46.0(we have abandoned strong backward compatibility forktlint, from here on out Spotless will only support the most-recent breaking change).
- Minimum supported version also bumped to
- Bump default
diktatversion to latest1.1.0->1.2.1(#1246)- Minimum supported version also bumped to
1.2.1(diktat is based on ktlint and has the same backward compatibility issues).
- Minimum supported version also bumped to
- Bump default
ktfmtversion to latest0.37->0.39(#1240)
PalantirJavaFormatStepno longer needs the--add-exportscalls in theorg.gradle.jvmargsproperty ingradle.properties. (#1233)
- (Second try)
googleJavaFormatandremoveUnusedImportsworks on JDK16+ without jvm args workaround. (#1228)- If you have a bunch of
--add-exportscalls in yourorg.gradle.jvmargsproperty ingradle.properties, you should be able to remove them. (fixes #834)
- If you have a bunch of
- Support for
editorConfigOverrideinktlint. (#1218 fixes #1193)- If you are using properties like
indent_size, you should pass now pass them aseditorConfigOverrideand not asuserData.
- If you are using properties like
googleJavaFormatandremoveUnusedImportsworks on JDK16+ without jvm args workaround. (#1224)- If you have a bunch of
--add-exportscalls in yourorg.gradle.jvmargsproperty ingradle.properties, you should be able to remove them. (fixes #834)
- If you have a bunch of
FormatExtension.createIndependentApplyTaskLazy, with same functionality ascreateIndependentApplyTaskLazybut returningTaskProvider(#1198)
- Update the
blackversion regex to fix19.10b0and earlier. (fixes #1195, regression introduced in6.5.0) - Improved daemon memory consumption (#1198 fixes #1194)
- Bump default
ktfmtversion to latest0.36->0.37. (#1200)
- Bump default
diktatversion to latest1.0.1->1.1.0. (#1190)
- Bump default
ktfmtversion to latest0.35->0.36. (#1183) - Bump default
google-java-formatversion to latest1.13.0->1.15.0.This means it is no longer necessary to use the--add-exportsworkaround (fixes #834).--add-exportsworkaround is still needed.
- Added a
runToFixMessageproperty to customize the run-to-fix message inspotlessChecktask. (#1175) - Added support for enabling ktlint experimental ruleset. (#1145)
- Fixed support for Python Black's new version reporting. (#1170)
- All tasks (including helper tasks) are now part of the
verificationgroup. (fixes #1050) - Error messages for unexpected file encoding now works on Java 8. (fixes #1081)
- Spotless now applies the
baseplugin to make sure that Spotless always has achecktask to hook into. (#1179, fixes #1164, reverts #1014)- Spotless used to work this way, we stopped applying base starting with version
6.0.3(released Dec 2021) in order to play nicely with a now-outdated Android template, but not applyingbasecauses more problems than it fixes (see #1164 for a good example). - If you have anything like
tasks.register<Delete>("clean"ortasks.register("clean", Delete), just change theregistertonamedso that you are configuring the existingcleancreated bybase, rather than creating a new task.
- Spotless used to work this way, we stopped applying base starting with version
- Bump default
blackversion to latest19.10b0->22.3.0. (#1170) - Bump default
ktfmtversion to latest0.34->0.35. (#1159) - Bump default
ktlintversion to latest0.43.2->0.45.2. (#1177)
- Git user config and system config also included for defaultEndings configuration. (#540)
- Fixed ktfmt options configuration in Gradle plugin for Gradle Kotlin scripts (kts).
- Accept
java.nio.charset.Charsettype when setting the character encoding viaencoding(#1128) - Added support for setting custom parameters for Kotlin ktfmt in Gradle plugin. (#1145)
- Use SLF4J for logging (#1116)
- Bump default ktfmt
0.30->0.31(#1118).
- Add full support for git worktrees (#1119).
- Bump default versions of formatters (#1095).
- google-java-format
1.12.0->1.13.0 - ktfmt
0.29->0.30
- google-java-format
- Added support for git property
core.autocrlf(#540)
- 🎉🎉🎉 IntelliJ plugin thanks to @ragurney 🎉🎉🎉
- Added support for the palantir-java-format Java formatter (#1083).
- Register
spotlessPredeclareextension with typeSpotlessExtensionPredeclareinstead of the sameSpotlessExtensionasspotlessso that Kotlin users can useconfigure<SpotlessExtensionPredeclare>(#1084).
- Update IndentStep to allow leading space on multiline comments (#1072).
- If the
baseplugin has already been applied, then there is no need for configuration of thecleantask to trigger configuration of the Spotless tasks (#1068).
- Bumped default DiKTat from
0.4.0to1.0.1. This is a breaking change for DiKTat users on the default version, because some rules were renamed/changed. Check DiKTat changelog for details.
- You can now predeclare formatter dependencies in the root project.
- specify one of:
spotless { predeclareDeps() }to resolve all deps from the root project, which will show up in dependency reports.spotless { predeclareDepsFromBuildscript() }to resolve all deps frombuildscript { repositories {, which will not show up in dependency reports (see #1027).- and then below that you have a block where you simply declare each formatter which you are using, e.g.
-
spotless { ... predeclareDepsFromBuildscript() } spotlessPredeclare { java { eclipse() } kotlin { ktfmt('0.28') } } - By default, Spotless resolves all dependencies per-project, and the predeclaration above is unnecessary in the vast majority of cases.
ratchetFromis now faster and uses less memory (#1038).
- Fix Gradle composite builds (#860).
- Spotless no longer applies
BasePlugin(#1014).- This was done to ensure that any Spotless tasks would run after the
cleantask, but we found a way to do this without applying theBasePlugin. This resolves a conflict with the Android Gradle template (fixes #858).
- This was done to ensure that any Spotless tasks would run after the
- Large parallel builds could throw
ConcurrentModificationException(masked by "Cannot add a configuration with name"), now fixed. (#1015)
- Bumped default ktlint from
0.43.0to0.43.2.
- Fixed problem with ktlint dependency variants (#993)
- Added
namedoption tolicenseHeaderto support alternate license header within same format (like java) (872). - Added
onlyIfContentMatchesoption tolicenseHeaderto skip license header application based on source file content pattern (#650). - Bump jgit version (#992).
- jgit
5.10.0.202012080955-r->5.13.0.202109080827-r
- jgit
- Support for Gradle Configuration Cache* (#982, #986)
- *Spotless must run on the same daemon that wrote the configuration cache. If it isn't, you'll get this error message:
-
Spotless JVM-local cache is stale. Regenerate the cache with rm -rf .gradle/configuration-cache - To make this daemon-restriction obsolete, please see and upvote #987.
- BREAKING Previously, many projects required
buildscript { repositories { mavenCentral() }}at the top of their root project, because Spotless resolved its dependencies using the buildscript repositories. Spotless now resolves its dependencies from the normal project repositories of each project with aspotless {...}block. This means that you can remove thebuildscript {}block, but you still need arepositories { mavenCentral() }(or similar) in each project which is using Spotless. (#980, #983)- If you prefer the old behavior, it is available via
predeclareDepsFromBuildscript()starting in6.1.0.
- If you prefer the old behavior, it is available via
- BREAKING
createIndepentApplyTask(String taskName)now requires thattaskNamedoes not end withApply - Bump minimum required Gradle from
6.1to6.1.1. - Bump default formatter versions (#989)
- google-java-format
1.11.0->1.12.0 - ktlint
0.42.1->0.43.0 - ktfmt
0.27->0.29 - scalafmt
3.0.0->3.0.8
- google-java-format
- BREAKING
removeFormat(which has been broken since5.0) has been removed. UseclearSteps()as a workaround (#653).
- Added support and bump Eclipse formatter default versions to
4.21foreclipse-groovy. Change is only applied for JVM 11+. - Added support for ktlint's FilenameRule (#974).
- Temporary workspace deletion for Eclipse based formatters on JVM shutdown (#967). Change is only applied for Eclipse versions using JVM 11+, no back-port to older versions is planned.
- Added support for calling local binary formatters (#963)
- module-info formatting in
eclipse-jdtversions4.20and4.21. Note that the problem also affects older versions. - Added workaround to support projects using git worktrees (#965)
- Added
wildcardsLast()option for JavaimportOrder(#954)
- Added support for JBDI bind list params in sql formatter (#955)
- Added support and bump Eclipse formatter default versions to
4.21foreclipse-cdt,eclipse-jdt,eclipse-wtp. Change is only applied for JVM 11+. - Added
groupArtifactoption forgoogle-java-format(#944)
- Added support and bump Eclipse formatter default versions for JVM 11+. For older JVMs the previous defaults remain.
eclipse-cdtfrom4.16to4.20eclipse-groovyfrom4.19to4.20eclipse-jdtfrom4.19to4.20eclipse-wtpfrom4.18to4.20
- Large parallel multiproject builds could sometimes generate hard-to-reproduce errors below (reported in #941, attempted fix in #942).
:spotlessInternalRegisterDependencies task failed.Cannot add a configuration with name 'spotless-1911100560'
- Spotless does not yet support configuration-cache, but now it can never interfere with configuration-cache for other tasks. (#720)
- Bump minimum required Gradle from
5.4to6.1.
- Added support for
google-java-format'sskip-reflowing-long-stringsoption (#929)
- Added support for scalafmt 3.0.0 and bump default scalafmt version to
3.0.0(#913). - Bump default versions (#915)
ktfmtfrom0.24to0.27ktlintfrom0.35.0to0.42.1google-java-formatfrom1.10.0to1.11.0
- Improved SQL formatting with respect to comments
- Improved exception messages for JSON formatting failures
- Added Gradle configuration JVM-based JSON formatting
- Fixed IndexOutOfBoundsException in parallel execution of
eclipse-groovyformatter (#877)
- Added support for
eclipse-cdtat4.19.0. Note that version requires Java 11 or higher. - Added support for
eclipse-groovyat4.18.0and4.19.0. - Added support for
eclipse-wtpat4.19.0. Note that version requires Java 11 or higher.
- Bump
eclipse-groovydefault version from4.17.0to4.19.0.
- Update ktfmt from 0.21 to 0.24
- The
<url>field in the Maven POM is now set correctly (#798) - Node is re-installed if some other build step removed it (#863)
- Dependency configurations are now named rather than detached, attempt to fix #815.
- Explicitly separate target file from git arguments when parsing year for license header to prevent command from failing on argument-like paths (#847)
- LicenseHeaderStep treats address as copyright year (#716)
- Fix license header bug for years in range (#840).
- Added support for
eclipse-jdtat4.19.0.
- Bump
eclipse-jdtdefault version from4.18.0to4.19.0. - Bump
google-java-formatdefault version from1.9to1.10.0. - Expose configuration exceptions from scalafmt (#837)
- Exclude
.git,.gradleandbuilddirectories when multiple targets are specified (#835).- As part of this fix,
**/blah.txtis now handled the same as**/*.txt, which was always the expected behavior. Very unlikely to cause any user-visible changes in behavior.
- As part of this fix,
- Ensure consistent ordering of task inputs for
RegisterDependenciesTask,bso the task isup-to-datewhen the spotless config has not changed.
- Bump ktfmt to 0.21 and add support to Google and Kotlinlang formats (#812)
- Allow licence headers to be blank (#801).
- Fixed the
cleantask when Gradle's configuration cache is enabled (#796)
- Support for diktat in KotlinGradleExtension (#789)
- Added support for
eclipse-cdt,eclipse-jdt, andeclipse-wtpat4.18.0.
- Bump
eclipse-jdtdefault version from4.17.0to4.18.0. - Bump
eclipse-wtpdefault version from4.17.0to4.18.0. - Bump
ktfmtdefault version from0.16to0.19(#748 and #773).
- Fixed
ratchetFromsupport for git-submodule (#746). - Fixed
ratchetFromexcess memory consumption (#735). ktfmtv0.19+ with dropbox-style works again (#765).prettierno longer throws errors on empty files (#751).- Fixed error when running on root of windows mountpoint (#760).
- No longer declare inputs on
SpotlessCheckandSpotlessApplysince they don't have any outputs (worker task still does up-to-date and caching) (#741).
- Fixed a bug which occurred if the root directory of the project was also the filesystem root (#732)
- Bump JGit from
5.8.0to5.9.0to improve performance (#726)
- Added support to npm-based steps for picking up
.npmrcfiles (#727)
- Added support for eclipse-cdt 4.14.0, 4.16.0 and 4.17.0 (#722).
- Added support for eclipse-groovy 4.14.0, 4.15.0, 4.16.0 and 4.17.0 (#722).
- Added support for eclipse-jdt 4.17.0 (#722).
- Added support for eclipse-wtp 4.14.0, 4.15.0, 4.16.0 and 4.17.0 (#722).
- Updated default eclipse-cdt from 4.13.0 to 4.16.0 (#722). Note that version 4.17.0 is supported, but requires Java 11 or higher.
- Updated default eclipse-groovy from 4.13.0 to 4.17.0 (#722).
- Updated default eclipse-jdt from 4.16.0 to 4.17.0 (#722).
- Updated default eclipse-wtp from 4.13.0 to 4.17.0 (#722).
5.6.0introduced a bug where it was no longer possible to configure a single format twice, e.g. to have twojava{}blocks in a single file. Fixed by #702.
withinBlocksallows you to apply rules only to specific sections of files, for example formatting javascript within html, code examples within markdown, and things like that (implements #412 - formatting inception).
- Don't assume that file content passed into Prettier is at least 50 characters (diffplug#699).
- Improved JRE parsing to handle strings like
16-loom(fixes #693).
- New option
toggleOffOn()which allows the tagsspotless:offandspotless:onto protect sections of code from the rest of the formatters (#691).
- When applying license headers for the first time, we are now more lenient about parsing existing years from the header (#690).
googleJavaFormat()default version is now1.9on JDK 11+, while continuing to be1.7on earlier JDKs. This is especially helpful toremoveUnusedImports(), since it always uses the default version of GJF (fixes #681).
- We did not proactively check to ensure that the Gradle version was modern enough, now we do (fixes #684).
- Added support for eclipse-jdt 4.14.0, 4.15.0 and 4.16.0 (#678).
- Updated default eclipse-jdt from 4.13.0 to 4.16.0 (#678).
- It is now much easier for Spotless to integrate formatters with native executables. (#672)
- Added support for python, specifically black.
- Added support for clang-format for all formats.
- If you executed
gradlew spotlessCheckmultiple times within a single second (hard in practice, easy for a unit test) you could sometimes get an erroneous failure message. Fixed in #671.
ktlint()is now more robust when parsing version string for version-dependent implementation details, fixes #668.
- Depending on the file system, executing
gradle spotlessApplymight change permission on the changed files from644to755; fixes (#656) - When using the
prettierortsfmtsteps, if any files were dirty thenspotlessCheckwould fail withjava.net.ConnectException: Connection refusedrather than the proper error message (#651).
- Bump default ktfmt from
0.15to0.16, and remove duplicated logic for the--dropbox-styleoption (#642)
- Bump default ktfmt from 0.13 to 0.15, and add support for the --dropbox-style option (#641).
This release is exactly the same as 4.5.1, except:
- it now has plugin id
com.diffplug.spotless, rather thancom.diffplug.gradle.spotless(why) - the minimum required Gradle has bumped from
2.14to5.4 - all deprecated functionality has been removed
-PspotlessModern=true(introduced in4.3.0) is now always on
If id 'com.diffplug.gradle.spotless' version '4.5.1' works without deprecation warnings, then you can upgrade to id 'com.diffplug.spotless' version '5.0.0' and no changes will be required.
- BREAKING All deprecated functionality has been removed (#640).
- (dev-only)
SpotlessTaskwas deleted, andSpotlessTaskModernwas renamed toSpotlessTask(ditto forSpotlessPluginandSpotlessExtension).
- (dev-only)
- Introduced in earlier versions, but formerly gated behind
-PspotlessModern=true- We now calculate incremental builds using the new
InputChangesrather than the deprecatedIncrementalTaskInputs. (#607) - We now use Gradle's config avoidance APIs. (#617)
- Spotless no longer creates any tasks eagerly. (#622)
- BREAKING The closures inside each format specification are now executed lazily on task configuration. (#618)
- We now calculate incremental builds using the new
String isEager = 'nope'
spotless {
java {
isEager = 'yup'
}
}
println "isEager $isEager"
// 'com.diffplug.gradle.spotless' -> isEager yup
// 'com.diffplug.spotless' -> isEager nope- Git-native handling of line endings was broken, now fixed (#639).
- Full support for the Gradle buildcache - previously only supported local, now supports remote too. Fixes #566 and #280, via changes in #621 and #571.
prettierwill now autodetect the parser (and formatter) to use based on the filename, unless you override this usingconfig()orconfigFile()with the optionparserorfilepath. (#620)- (user-invisible) moved the deprecated lib code which was only being used in deprecated parts of
plugin-gradleinto the.libdeprecatedpackage. (#630) - Added ANTLR4 support (#326).
- LineEndings.GIT_ATTRIBUTES is now a bit more efficient, and paves the way for remote build cache support in Gradle. (#621)
ratchetFromnow ratchets from the merge base ofHEADand the specified branch. This fixes the surprising behavior when a remote branch advanced (#631 fixes #627).
- The default targets for
C/C++,freshmark,sql, andtypescriptnow generate a warning, asking the user to specify a target manually. There is no well-established convention for these languages in the Gradle ecosystem, and the performance of the default target is far worse than a user-provided one. If you dislike this change, please complain in #634. customLazyandcustomLazyGroovynow generate a warning, asking the user to migrate tocustom. There is no longer a performance advantage tocustomLazyin the new modern plugin. See #635 for example migrations.- inside the
cpp { }block, theeclipsestep now generates a warning, asking you to switch toeclipseCdt. It is the same underlying step, but the new name clears up any confusion with the more common Javaeclipse. #636
- It is now possible to have multiple language-specific formats. (9a02419)
import com.diffplug.gradle.spotless.KotlinExtension
spotless {
kotlin {
target 'src/**/*.kt'
ktlint()
}
format 'kotlinScript', KotlinExtension, {
target 'src/**/*.kts'
ktfmt()
}
}- Nodejs-based formatters
prettierandtsfmtnow 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
prettierversions (instead of being stuck at prettier version <=1.19.0) - Bumped default versions, prettier
1.16.4->2.0.5, tslint5.12.1->6.1.2
- Using
ratchetFrom 'origin/main'on a bare checkout generated a cryptic error, now generates a clear error. (#608) - Using
ratchetFrom 'nonexistent-referencegenerated a cryptic error, now generates a clear error. (#612)
-PspotlessFileshas been deprecated and will be removed. It is slow and error-prone, especially for win/unix cross-platform, and we have better options available now:- If you are formatting just one file, try the much faster IDE hook
- If you are integrating with git, try the much easier (and faster)
ratchetFrom 'origin/main' - If neither of these work for you, let us know in this PR.
- If you specify
-PspotlessSetLicenseHeaderYearsFromGitHistory=true, Spotless will perform 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) - It is now possible for individual formats to set their own
ratchetFromvalue, similar to how formats can have their ownencoding. (#605). - (spotless devs only) if you specify
-PspotlessModern=trueSpotless will run the in-progress Gradle5.4+code. ThemodernTestbuild task runs our test suite in this way. It will be weeks/months before this is recommended for end-users. (#598)
ratchetFromincorrectly marked every file as though it were clean on Windows. (#596)- Improved the warning message for
paddedCelldeprecation, along with many API-invisible fixes and cleanup. (#592)
- If you use
ratchetFromandlicenseHeader, the year in your license header will now be automatically kept up-to-date for changed files. For example, if the current year is 2020: (#593)/** Copyright 2020 */-> unchanged/** Copyright 1990 */->/** Copyright 1990-2020 *//** Copyright 1990-1993 */->/** Copyright 1990-2020 */- You can disable this behavior with
licenseHeader(...).updateYearWithLatest(false), or you can enable it without usingratchetFromby usingupdateYearWithLatest(true)(not recommended).
ratchetFromhad a bug (now fixed) such that it reported all files outside the root directory as changed. (#594)
- You can now ratchet a project's style by limiting Spotless only to files which have changed since a given git reference, e.g.
ratchetFrom 'origin/main'. (#590) - Support for ktfmt in KotlinGradleExtension. (#583)
- Users can now run
spotlessCheckandspotlessApplyin the same build. (#584) - Fixed intermittent
UnsatisfiedLinkErrorin nodejs-based steps. (#586)- Also, a shared library used by the nodejs steps used to be extracted into the user home directory, but now it is extracted into
{rootProject}/build/spotless-nodejs-cache.
- Also, a shared library used by the nodejs steps used to be extracted into the user home directory, but now it is extracted into
- Fixed intermittent
java.nio.file.DirectoryNotEmptyExceptionon incremental builds where folders had been removed. (#589) - Starting in
4.0, it is no longer possible for a project to format files which are not within its project folder (for example,:acan no longer format files in:b). We did not explicitly note this in the changelog entry for4.0, and we gave a very confusing error message if users tried. We now give a more helpful error message, and this breaking change has been retroactively noted in the changelog for4.0.0. (#588)
- If the encoding was set incorrectly,
spotlessApplycould clobber special characters. Spotless now prevents this, and helps to suggest the correct encoding. (#575)
TLDR: This version improves performance and adds support for the local Gradle Build Cache. You will not need to make any changes in your buildscript. It is a breaking change only for a few users who have built other plugins on top of this one.
- Support for the Gradle build cache. (#576)
- The local cache will work great, but the remote cache will always miss until #566 is resolved.
- BREAKING it used to be possible for any project to format files in any other project. For example,
:acould format files in:b. It is now only possible to format files within the project directory. It is okay (but not advised) to format files in subprojects, since they are within the project directory. - (Power users only) BREAKING
void SpotlessTask::setCheck()andsetApply()have been removed. (#576)- Previously, the
checkandapplytasks were just marker tasks, and they calledsetCheckandsetApplyon the "worker" task. Nowcheckandapplyare real tasks in their own right, so the marker-task kludge is no longer necessary.
- Previously, the
- (Power users only) BREAKING
SpotlessTask FormatExtension::createIndependentTaskhas been removed, and replaced withSpotlessApply::createIndependentApplyTask. (#576) - Improve suggested Gradle invocation for running
spotlessApply. (#578)
-PspotlessIdeHookwhich makes the VS Code extension faster and more reliable. SeeIDE_INTEGRATION.mdfor more details. (#568)
- 🎉🎉🎉 VS Code Extension thanks to @badsyntax 🎉🎉🎉
- Support for google-java-format 1.8 (requires build to run on Java 11+) (#562)
- Support for ktfmt 0.13 (requires build to run on Java 11+) (#569)
- PaddedCell is now always enabled. It is strictly better than non-padded cell, and there is no performance penalty. See here for detailed explanation. (#561)
- Updated a bunch of dependencies, most notably jgit
5.5.0.201909110433-r->5.7.0.202003110725-r. (#564)
- Eclipse-WTP formatter (web tools platform, not java) handles some character encodings incorrectly on OS with non-unicode default file encoding #545. Fixed for Eclipse-WTP formatter Eclipse version 4.13.0 (default version).
- Enable IntelliJ-compatible token
$today.yearfor specifying the year in license header files. (#542)
- 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).
- Add tests to
SpecificFilesTestto fix #529 - If you applied spotless to a subproject, but not to the root project, then on Gradle 6+ you would get the deprecation warning
Using method Project#afterEvaluate(Action) when the project is already evaluated has been deprecated.This has now been fixed. (#506)
licenseHeaderandlicenseHeaderFileaccidentally returned a package-private config object, which is now public, fixes (#505).
- Added method
FormatExtension.createIndependentTask(String taskName)which allows creating a Spotless task outside of thecheck/applylifecycle. See javadoc for details. (#500) - Running
cleanandspotlessCheckduring a parallel build could cause exceptions, fixed by (#501). - Fixed Gradle 7 deprecation warnings that started being emitted in Gradle 6. (#503)
- Even if you're using a pre-6.0 version of Gradle, you will probably see small performance and stability improvements. The PR above finally fixed the root problems of (#372).
- Revert the change in console display of errors from 3.26.0 (#485) because of these problems.
- Bugfix: Fix NPE in EclipseXmlFormatterStepImpl (#489)
- Fix project URLs in poms. (#478)
- Fix
ImportSortercrashing with empty files. (#474)- Fixes #305 StringIndexOutOfBoundsException for empty Groovy file when performing importOrder
- Bugfix: CDT version
4.12.0now properly uses9.8, whereas before it used9.7. (#482) - Updated default eclipse-wtp from 4.12.0 to 4.13.0 (#482).
- Updated default eclipse-groovy from 4.12.0 to 4.13.0 (#482).
- Updated default eclipse-jdt from 4.12.0 to 4.13.0 (#482).
- Updated default eclipse-cdt from 4.12.0 to 4.13.0 (#482).
- Bump default version of KtLint from
0.34.2to0.35.0. (#473) - Several improvements to the console display of formatting errors. (#465)
- Spotless no longer breaks configuration avoidance for other tasks (specifically the
checktask and all of its dependees) (#463).- Important change: Formerly, Spotless did not create its tasks until the
afterEvaluatephase. Spotless now creates them as soon as the plugin is applied, and it creates the format-specific tasks as soon as the formats are defined. There is no performance degradation associated with this change, and it makes configuring Spotless easier.
- Important change: Formerly, Spotless did not create its tasks until the
- Add support for ktlint
0.34+, and bump default version from0.32.0to0.34.2. (#469)
- Update jgit from
5.3.2.201906051522-rto5.5.0.201909110433-r. (#445)- Fixes #410 AccessDeniedException in MinGW/GitBash.
- Also fixes occasional hang on NFS due to filesystem timers.
- 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)
- Fixed a bad but simple bug in
paddedCell()(#455)- if a formatter was behaving correctly on a given file (was idempotent)
- but the file was not properly formatted
spotlessCheckwould improperly say "all good" even thoughspotlessApplywould properly change them- combined with up-to-date checking, could lead to even more confusing results, (#338)
- Fixed now!
- When you specify
targetExclude(), spotless no longer silently removesbuilddirectories from the exclusion (#457). - Bumped
scalafmtdefault version from1.1.0to2.0.1, since there are bugs in the old default (#458).
- Fixed
Warning deprecated usage found: Using the incremental task API without declaring any outputs has been deprecated.that started appearing in Gradle 5.5 (#434).
- Fixes class loading issue with Java 9+ (#426).
- 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 3.26.0
- Added new Maven coordinates for scalafmt 2.0.0+, maintains backwards compatability (#415)
- Fixes incorrect M2 cache directory path handling of Eclipse based formatters (#401)
- Update jgit from
4.9.0.201710071750-rto5.3.2.201906051522-rbecause Gradle project is sometimes broken byapache httpcomponentsin transitive dependency. (#407)
- Updated default ktlint from 0.21.0 to 0.32.0, and Maven coords to com.pinterest (#394)
- Updated default eclipse-cdt from 4.7.3a to 4.11.0 (#390).
- Fixes incorrect plugin and pom metadata in
3.21.0(#388).
- 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).
- Fixed intermittent concurrency error while downloading formatter dependencies in multi-project builds (#372).
- Made npm package versions of
prettierandtsfmt(and its internal packages) configurable. (#363)- Updated default npm package version of
prettierfrom 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 npm package version of
- Updated default eclipse-wtp from 4.7.3a to 4.7.3b (#371).
- 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.
WARNING: xml formatter in this version may be vulnerable to XXE attacks, fixed in 3.20.0 (see #358).
- Security fix: Updated groovy, c/c++, and eclipse WTP formatters so that they download their source jars securely using
httpsrather thanhttp(#360). - Updated default eclipse-jdt from 4.9.0 to 4.10.0 (#368)
WARNING: xml formatter in this version may be vulnerable to XXE attacks, fixed in 3.20.0 (see #358).
- Provided eclipse-wtp formatters in generic formatter extension. (#325). This change obsoletes the CSS and XML extensions.
- Improved configuration times for large projects (thanks to @oehme for finding #348).
- Updated default google-java-format from 1.5 to 1.7 (#335).
- Replacing a step no longer triggers early evaluation (#219).
importOrderFile(Object file)for java and groovy is now lazy (#218).- added
targetExclude(Object...)which excludes the given files from processing (#353).- This resolves several related issues:
- Our answer for a long time had been "just use
target(Object...)to fix this" but there is clearly sufficient demand to justifytargetExclude.
WARNING: xml formatter in this version may be vulnerable to XXE attacks, fixed in 3.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).
- Added
-spotlessFilesswitch to allow targeting specific files (#322)
WARNING: xml formatter in this version may be vulnerable to XXE attacks, fixed in 3.20.0 (see #358).
- Added support for Eclipse's CSS formatter from WTP (#311).
WARNING: xml formatter in this version may be vulnerable to XXE attacks, fixed in 3.20.0 (see #358).
- Added
xmlsupport (#140) using formatter of Eclipse WTP 3.9.5 (#241). - Added
prettierandtsfmtsupport (#283). - Added C/C++ support using formatter of Eclipse CDT 9.4.3 (#232).
- Updated default groovy-eclipse from 4.8.0 to 4.8.1 (#288). New version is based on Groovy-Eclipse 3.0.0.
- LicenseHeaderStep now wont attempt to add license to
module-info.java(#272). - 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)
- Gradle/Groovy
importOrderno longer adds semicolons. (#237)
- Updated default eclipse-jdt from 4.7.2 to 4.7.3a (#263). New version fixes a bug preventing Java code formatting within JavaDoc comments (#191).
- Updated default groovy-eclipse from 4.6.3 to 4.8.0 (#244). New version allows to ignore internal formatter errors/warnings.
- Fixed integration with latest versions of scalafmt. (#260)
- Add line and column numbers to ktlint errors. (#251)
- Migrated
plugin-gradle's tests away fromTaskInternal#executeto a custom method to help with Gradle 5.0 migration later on. (#208) - Fixed a bug in
LicenseHeaderStepwhich 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. See README for details.
- Added interface
HasBuiltinDelimiterForLicenseto language extensions that have pre-defined licence header delimiter. (#235)
- LicenseHeaderStep now supports customizing the year range separator in copyright notices. (#199)
- 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
googleJavaFormatto switch the formatter style (#193)- Use
googleJavaFormat().aosp()to use AOSP-compliant style (4-space indentation) instead of the default Google Style
- Use
- Bugfix: if the specified target of a spotless task was reduced, Spotless could keep giving warnings until the cache file was deleted.
- LicenseHeader now supports time-aware license headers. (docs, #179, thanks to @baptistemesta)
- Updated default eclipse-jdt version to
4.7.1from4.6.3. - All spotless tasks now run before the
cleantask. (#159) - Added
sql(#166) anddbeaverSql. (#166)- Many thanks to Baptiste Mesta for porting to Spotless.
- Many thanks to DBeaver and the DBeaver contributors for building the implementation.
- Fix licenseHeader so it works with Kotlin files starting with
@file:...instead ofpackage ...(#136).
- Fixed
kotlinGradlelinting Gradle Kotlin DSL files throwingParseException(#132).
- Changed
importOrderinterface from array to varargs (#125). - The
kotlinextension was mis-spelled askotin. - Added
kotlinGradlemethod toSpotlessExtensionfor linting Gradle Kotlin DSL files with ktlint (#115) - Added dedicated
groovyGradlefor formatting of Gradle files.
- Default eclipse version for
EclipseFormatterStepbumped to4.6.3from4.6.1. (#116) - Default scalafmt version for
ScalaFmtStepbumped to1.1.0from0.5.7(#124)- Also added support for the API change to scalafmt introduced in
0.7.0-RC1
- Also added support for the API change to scalafmt introduced in
- Fixed wildcard targets for
includeFlatsubprojects (#121) - When spotless needs to download a formatter, it now uses the buildscript repositories specified in the root buildscript. (#123, #120)
ImportOrderStepcan now handle multi-line comments and misplaced imports.- Groovy extension now checks for the
groovyplugin to be applied. - Deprecated the old syntax for the eclipse formatter:
- New syntax better separates the version from the other configuration options, and is more consistent with the other
eclipseFormatFile('format.xml')->eclipse().configFile('format.xml')eclipseFormatFile('4.4.0', 'format.xml')->eclipse('4.4.0').configFile('format.xml')
- Fixed a bug in
paddedCell()which causedspotlessCheckto fail even afterspotlessApplyfor cases where a rule is misbehaving and causing a cycle.
- Added support for groovy formatting (huge thanks to Frank Vennemeyer! #94, #89, #88, #85)
- When special-purpose formatters need to be downloaded from maven, they are now resolved using the buildscript repositories rather than the project repositories. (thanks to cal101 #100)
- Update default KtLint from 0.3.1 to 0.6.1 (thanks to @kvnxiao #93).
- This means we no longer look for rules in the typo package
com.gihub.shyiko, now only incom.github.shyiko(note thet).
- This means we no longer look for rules in the typo package
- Added an
enforceCheckproperty which allows users to disable addingspotlessCheckas a dependency ofcheck(thanks to @gdecaso #95). - Any errors in a step will now fail the build] - 201x-xx-xx previously they were only warned.
- We claimed that we implemented this in 3.1.0, but it was broken. We really fixed it this time.
- Added support for Scala via scalafmt.
- Added support for Kotlin via ktlint.
- Added
FormatExtension::replaceStep. paddedCell()is no longer required if a misbehaving rule converges.- Any errors in a step will now fail the build] - 201x-xx-xx previously they were only warned.
- Added
FormatExtension::ignoreErrorForStepandFormatExtension::ignoreErrorForPath. - Bumped
google-java-formatto1.3.
- BREAKING CHANGE:
customReplaceandcustomReplaceRegexrenamed to justreplaceandreplaceRegex. - BREAKING CHANGE: Plugin portal ID is still
com.diffplug.gradle.spotless, but Maven coordinate has changed tocom.diffplug.spotless:spotless-plugin-gradle. - HUGE SPEEDUP: Now supports incremental build / up-to-date-checking.
- If you are using
customorcustomLazy, you might want to take a look at this javadoc.
- If you are using
- BREAKING CHANGE:
freshmarkno longer includes all project properties by default. All properties must now be added manually:
spotless {
freshmark {
propertiesFile('gradle.properties')
properties {
it.put('key', 'value')
}
}
}- Fixed googleJavaFormat so that it can now sort imports and remove unused imports.
- Added an à la carte
removeUnusedImports()step.
- Java files under the
src/main/groovyfolder are now formatted by default. (Issue #59, PR #60, thanks @ajoberstar).
- If a formatter step throws an
Erroror any of its subclasses, such as theAssertionErrors thrown by JUnit, AssertJ, etc. that error will kill the build (#46)- This allows custom rules like this:
custom 'no swearing', {
if (it.toLowerCase().contains('fubar')) {
throw new AssertionError('No swearing!');
}
}- When
spotlessCheckfails, the error message now contains a short diff of what is neccessary to fix the issue (#10, thanks to Jonathan Bluett-Duncan). - Added a padded-cell mode which allows spotless to band-aid over misbehaving rules, and generate error reports for these rules (See #37 for an example).
- Character encoding is now configurable (spotless-global or format-by-format).
- Line endings were previously only spotless-global, they now also support format-by-format.
- Upgraded eclipse formatter from 4.6.0 to 4.6.1
- Added support for google-java-format.
spotless {
java {
googleJavaFormat() // googleJavaFormat('1.1') to specify a specific version
}
}
- Added the method
FormatExtension::customLazyGroovywhich fixes the Groovy closure problem.
spotlessApplynow writes out a file only if it needs to be changed (big performance improvement).- Java import sorting now removes duplicate imports.
- Eclipse formatter now warns if the formatter xml contains multiple profiles.
- Updated eclipse formatter to Eclipse Neon (4.6).
- BREAKING CHANGE: Eclipse formatter now formats javadoc comments.
- You might want to look at the following settings in your
spotless.eclipseformat.xml:
- You might want to look at the following settings in your
org.eclipse.jdt.core.formatter.join_lines_in_comments=true/false
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true/false
org.eclipse.jdt.core.formatter.comment.format_line_comments=true/false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true/false
The most important breaking change of 2.0 is the new default line ending mode, GIT_ATTRIBUTES. This line ending mode copies git's behavior exactly. This change should require no intervention from users, and should be significantly easier to adopt for users who are already using .gitattributes or the core.eol property.
If you aren't using git, you can still use .gitattributes files for fine-grained control of line endings. If no git information is found, it behaves the same as PLATFORM_NATIVE (the old default).
Below is the algorithm used by git and spotless to determine the proper line ending for a file. As soon as a step succeeds in finding a line ending, the other steps will not take place.
- If the code is a git repository, look in the
$GIT_DIR/info/attributesfile for theeolattribute. - Look at the
.gitattributesin the file's directory, going up the directory tree. - Look at the global
.gitattributesfile, if any. - Look at the
core.eolproperty in the git config (looking first at repo-specific, then user-specific, then system-specific). - Use the PLATFORM_NATIVE line ending.
- Upgraded Eclipse formatter to 4.5.2, which fixes 37 bugs compared to the previous 4.5.0.
- If you have been using
custom 'Lambda fix', { it.replace('} )', '})').replace('} ,', '},') }, you don't need it anymore.
- Spotless no longer clobbers package-info.java, fixes #1.
- Added some infrastructure which allows
FormatterSteps to peek at the filename if they really need to.
- Bumped the FreshMark dependency to 1.3.0, because it offers improved error reporting.
- Added native support for FreshMark.
- Updated from Eclipse 4.5 M6 to the official Eclipse 4.5 release, which fixes several bugs in the formatter.
- Fixed a bug in the import sorter which made it impossible to deal with "all unmatched type imports".
- Formatting is now relative to the project directory rather than the root directory.
- Improved the logging levels.
- No functional changes, probably not worth the time for an upgrade.
- First version which is available on plugins.gradle.org as well as jcenter.
- Removed some code that was copy-pasted from Durian, and added a Durian dependency.
- Initial release.
- First release, to test out that we can release to jcenter and whatnot.