Skip to content

Latest commit

 

History

History
310 lines (214 loc) · 25.4 KB

CHANGES.md

File metadata and controls

310 lines (214 loc) · 25.4 KB

spotless-plugin-gradle releases

Version 3.22.0-SNAPSHOT - TBD (javadoc, snapshot)

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

Version 3.21.1 - March 29th 2019 (javadoc, jcenter)

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

Version 3.21.0 - March 28th 2019 (javadoc, jcenter)

  • 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).

Version 3.20.0 - March 11th 2019 (javadoc, jcenter)

  • 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).
  • 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.

Version 3.19.0 - March 11th 2019 (javadoc, jcenter)

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 https rather than http (#360).
  • Updated default eclipse-jdt from 4.9.0 to 4.10.0 (#368)

Version 3.18.0 - February 11th 2019 (javadoc, jcenter)

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:
      • #153 using a PatternFilterable to determine source processed by JavaExtension and KotlinExtension
      • #194 ignoreErrorForPath does not work
      • #324 better support for excluding files from processing
    • Our answer for a long time had been "just use target(Object...) to fix this" but there is clearly sufficient demand to justify targetExclude.

Version 3.17.0 - December 13th 2018 (javadoc, jcenter)

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 -spotlessFiles switch to allow targeting specific files (#322)

Version 3.16.0 - October 30th 2018 (javadoc, jcenter)

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).

Version 3.15.0 - September 23rd 2018 (javadoc, jcenter)

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

  • Added xml support (#140) using formatter of Eclipse WTP 3.9.5 (#241).
  • Added prettier and tsfmt support (#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 importOrder no longer adds semicolons. (#237)

Version 3.14.0 - July 24th 2018 (javadoc, jcenter)

  • 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)

Version 3.13.0 - June 1st 2018 (javadoc, jcenter)

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

Version 3.12.0 - May 14th 2018 (javadoc, jcenter)

  • Migrated plugin-gradle's tests away from TaskInternal#execute to a custom method to help with Gradle 5.0 migration later on. (#208)
  • 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. See README for details.
  • Added interface HasBuiltinDelimiterForLicense to language extensions that have pre-defined licence header delimiter. (#235)

Version 3.10.0 - February 15th 2018 (javadoc, jcenter)

  • LicenseHeaderStep now supports customizing the year range separator in copyright notices. (#199)

Version 3.9.0 - February 5th 2018 (javadoc, jcenter)

  • 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)
    • Use googleJavaFormat().aosp() to use AOSP-compliant style (4-space indentation) instead of the default Google Style

Version 3.8.0 - January 2nd 2018 (javadoc, jcenter)

  • 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)

Version 3.7.0 - December 2nd 2017 (javadoc, jcenter)

  • Updated default eclipse-jdt version to 4.7.1 from 4.6.3.
  • All spotless tasks now run before the clean task. (#159)
  • Added sql (#166) and dbeaverSql. (#166)

Version 3.6.0 - September 29th 2017 (javadoc, jcenter)

  • Fixes a rare up-to-date bug. (#144 and #146)

Version 3.5.2 - September 5th 2017 (javadoc, jcenter)

  • Fix licenseHeader so it works with Kotlin files starting with @file:... instead of package ... (#136).

Version 3.5.1 - August 14th 2017 (javadoc, jcenter)

Version 3.5.0 - August 13th 2017 (javadoc, jcenter)

  • Changed importOrder interface from array to varargs (#125).
  • The kotlin extension was mis-spelled as kotin.
  • Added kotlinGradle method to SpotlessExtension for linting Gradle Kotlin DSL files with ktlint (#115)
  • Added dedicated groovyGradle for formatting of Gradle files.

Version 3.4.1 - July 11th 2017 (javadoc, jcenter)

  • 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
  • Fixed wildcard targets for includeFlat subprojects (#121)
  • When spotless needs to download a formatter, it now uses the buildscript repositories specified in the root buildscript. (#123, #120)

Version 3.4.0 - May 21st 2017 (javadoc, jcenter)

  • ImportOrderStep can now handle multi-line comments and misplaced imports.
  • Groovy extension now checks for the groovy plugin to be applied.
  • Deprecated the old syntax for the 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')

Version 3.3.2 - May 3rd 2017 (javadoc, jcenter)

  • Fixed a bug in paddedCell() which caused spotlessCheck to fail even after spotlessApply for cases where a rule is misbehaving and causing a cycle.

Version 3.3.0 - April 11th 2017 (javadoc, jcenter)

  • 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)

Version 3.2.0 - April 3rd 2017 (javadoc, jcenter)

  • 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 in com.github.shyiko (note the t).
  • Added an enforceCheck property which allows users to disable adding spotlessCheck as a dependency of check (thanks to @gdecaso #95).
  • Any errors in a step will now fail the build - 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.

Version 3.1.0 - February 27th 2017 (javadoc, jcenter)

  • 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 - previously they were only warned.
  • Added FormatExtension::ignoreErrorForStep and FormatExtension::ignoreErrorForPath.
  • Bumped google-java-format to 1.3.

Version 3.0.0 - January 9th 2017 (javadoc, jcenter)

  • BREAKING CHANGE: customReplace and customReplaceRegex renamed to just replace and replaceRegex.
  • BREAKING CHANGE: Plugin portal ID is still com.diffplug.gradle.spotless, but maven coordinate has changed to com.diffplug.spotless:spotless-plugin-gradle.
  • HUGE SPEEDUP: Now supports incremental build / up-to-date-checking.
    • If you are using custom or customLazy, you might want to take a look at this javadoc.
  • BREAKING CHANGE: freshmark no 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.

Version 2.4.1 - January 2nd 2017 (javadoc, jcenter)

  • Java files under the src/main/groovy folder are now formatted by default. (Issue #59, PR #60, thanks @ajoberstar).

Version 2.4.0 - November 1st 2016 (javadoc, jcenter)

  • If a formatter step throws an Error or any of its subclasses, such as the AssertionErrors 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!');
  }
}

Version 2.3.0 - October 27th 2016 (javadoc, jcenter)

  • When spotlessCheck fails, 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

Version 2.2.0 - October 7th 2016 (javadoc, jcenter)

spotless {
  java {
    googleJavaFormat()  // googleJavaFormat('1.1') to specify a specific version
  }
}

Version 2.1.0 - October 7th 2016 (javadoc, jcenter)

  • Added the method FormatExtension::customLazyGroovy which fixes the Groovy closure problem.

Version 2.0.0 - August 16th 2016 (javadoc, jcenter)

  • spotlessApply now 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:
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.

  1. If the code is a git repository, look in the $GIT_DIR/info/attributes file for the eol attribute.
  2. Look at the .gitattributes in the file's directory, going up the directory tree.
  3. Look at the global .gitattributes file, if any.
  4. Look at the core.eol property in the git config (looking first at repo-specific, then user-specific, then system-specific).
  5. Use the PLATFORM_NATIVE line ending.

Version 1.3.3 - March 10th 2016 (jcenter)

  • 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.

Version 1.3.2 - December 17th 2015 (jcenter)

  • 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.

Version 1.3.1 - September 22nd 2015 (jcenter)

  • Bumped the FreshMark dependency to 1.3.0, because it offers improved error reporting.

Version 1.3.0 - September 22nd 2015 (jcenter)

  • Added native support for FreshMark.

Version 1.2.0 - August 25th 2015 (jcenter)

  • 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.

Version 1.1 - May 14th 2015 (jcenter)

  • 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.

Version 1.0 - April 29th 2015 (jcenter)

  • Initial release.

Version 0.1 - April 28th 2015 (jcenter)

  • First release, to test out that we can release to jcenter and whatnot.