File tree Expand file tree Collapse file tree 7 files changed +17
-8
lines changed
lib/src/main/java/com/diffplug/spotless/kotlin
src/main/java/com/diffplug/gradle/spotless
main/java/com/diffplug/spotless
test/java/com/diffplug/spotless/kotlin Expand file tree Collapse file tree 7 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1111
1212## [ Unreleased]
1313### Changed
14+ * Bumped default ktlint from ` 0.43.0 ` to ` 0.43.2 ` .
1415* Converted ` ktlint ` integration to use a compile-only source set. ([ #524 ] ( https://github.com/diffplug/spotless/issues/524 ) )
1516
1617## [ 2.20.1] - 2021-12-01
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public class KtLintStep {
3737 // prevent direct instantiation
3838 private KtLintStep () {}
3939
40- private static final String DEFAULT_VERSION = "0.43.0 " ;
40+ private static final String DEFAULT_VERSION = "0.43.2 " ;
4141 static final String NAME = "ktlint" ;
4242 static final String PACKAGE_PRE_0_32 = "com.github.shyiko" ;
4343 static final String PACKAGE = "com.pinterest" ;
Original file line number Diff line number Diff line change 33We adhere to the [ keepachangelog] ( https://keepachangelog.com/en/1.0.0/ ) format (starting after version ` 3.27.0 ` ).
44
55## [ Unreleased]
6+ ### Changed
7+ * Bumped default ktlint from ` 0.43.0 ` to ` 0.43.2 ` .
8+ ### Fixed
9+ * Fixed problem with ktlint dependency variants ([ #993 ] ( https://github.com/diffplug/spotless/issues/993 ) )
610
711## [ 6.0.1] - 2021-12-01
8-
912### Changed
1013* Added ` named ` option to ` licenseHeader ` to support alternate license header within same format (like java) ([ 872] ( https://github.com/diffplug/spotless/issues/872 ) ).
1114* Added ` onlyIfContentMatches ` option to ` licenseHeader ` to skip license header application based on source file content pattern ([ #650 ] ( https://github.com/diffplug/spotless/issues/650 ) ).
Original file line number Diff line number Diff line change 2626
2727import org .gradle .api .Project ;
2828import org .gradle .api .artifacts .Configuration ;
29+ import org .gradle .api .attributes .Bundling ;
2930
3031import com .diffplug .common .collect .ImmutableList ;
3132import com .diffplug .spotless .Provisioner ;
@@ -76,6 +77,9 @@ private static Provisioner forProject(Project project) {
7677 .forEach (config .getDependencies ()::add );
7778 config .setDescription (mavenCoords .toString ());
7879 config .setTransitive (withTransitives );
80+ config .attributes (attr -> {
81+ attr .attribute (Bundling .BUNDLING_ATTRIBUTE , project .getObjects ().named (Bundling .class , Bundling .EXTERNAL ));
82+ });
7983 return config .resolve ();
8084 } catch (Exception e ) {
8185 String projName = project .getPath ().substring (1 ).replace (':' , '/' );
Original file line number Diff line number Diff line change 33We adhere to the [ keepachangelog] ( https://keepachangelog.com/en/1.0.0/ ) format (starting after version ` 1.27.0 ` ).
44
55## [ Unreleased]
6+ ### Changed
7+ * Bumped default ktlint from ` 0.43.0 ` to ` 0.43.2 ` .
68
79## [ 2.17.5] - 2021-12-01
8-
910### Changed
1011* Bump jgit version ([ #992 ] ( https://github.com/diffplug/spotless/pull/992 ) ).
1112 * jgit ` 5.10.0.202012080955-r ` -> ` 5.13.0.202109080827-r `
Original file line number Diff line number Diff line change 3131import org .gradle .api .artifacts .Dependency ;
3232import org .gradle .api .artifacts .ResolveException ;
3333import org .gradle .api .artifacts .dsl .RepositoryHandler ;
34+ import org .gradle .api .attributes .Bundling ;
3435import org .gradle .testfixtures .ProjectBuilder ;
3536
3637import com .diffplug .common .base .Errors ;
@@ -68,6 +69,9 @@ private static Provisioner createWithRepositories(Consumer<RepositoryHandler> re
6869 Configuration config = project .getConfigurations ().detachedConfiguration (deps );
6970 config .setTransitive (withTransitives );
7071 config .setDescription (mavenCoords .toString ());
72+ config .attributes (attr -> {
73+ attr .attribute (Bundling .BUNDLING_ATTRIBUTE , project .getObjects ().named (Bundling .class , Bundling .EXTERNAL ));
74+ });
7175 try {
7276 return config .resolve ();
7377 } catch (ResolveException e ) {
Original file line number Diff line number Diff line change 1515 */
1616package com .diffplug .spotless .kotlin ;
1717
18- import org .junit .jupiter .api .Disabled ;
1918import org .junit .jupiter .api .Test ;
2019
2120import com .diffplug .spotless .FormatterStep ;
2928 * causes these problems. The root is still a gradle bug, but in the meantime we don't
3029 * need to hold up *every* PR with this: https://github.com/gradle/gradle/issues/11752
3130 */
32- @ Disabled
3331class KtLintStepTest extends ResourceHarness {
3432 @ Test
3533 void behavior () throws Exception {
36- // Must use jcenter (GONE) because `com.andreapivetta.kolor:kolor:0.0.2` isn't available on mavenCentral.
37- // It is a dependency of ktlint.
3834 FormatterStep step = KtLintStep .create (TestProvisioner .mavenCentral ());
3935 StepHarness .forStep (step )
4036 .testResource ("kotlin/ktlint/basic.dirty" , "kotlin/ktlint/basic.clean" )
4137 .testResourceException ("kotlin/ktlint/unsolvable.dirty" , assertion -> {
4238 assertion .isInstanceOf (AssertionError .class );
43- assertion .hasMessage ("Error on line: 1, column: 1 \n " +
39+ assertion .hasMessage ("Error on line: 1, column: 2 \n " +
4440 "Wildcard import" );
4541 });
4642 }
You can’t perform that action at this time.
0 commit comments