Skip to content

Commit

Permalink
Update relevant ktlint refs to pinterest
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Oct 6, 2019
1 parent 9713eda commit 3812713
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ You might be looking for:
### Version 1.1.0 - February 27th 2017 (javadoc [lib](https://diffplug.github.io/spotless/javadoc/spotless-lib/1.1.0/) [lib-extra](https://diffplug.github.io/spotless/javadoc/spotless-lib-extra/1.1.0/), artifact [lib]([jcenter](https://bintray.com/diffplug/opensource/spotless-lib), [lib-extra]([jcenter](https://bintray.com/diffplug/opensource/spotless-lib-extra)))

* Added support for Scala via [scalafmt](https://github.com/olafurpg/scalafmt).
* Added support for Kotlin via [ktlint](https://github.com/shyiko/ktlint).
* Added support for Kotlin via [ktlint](https://github.com/pinterest/ktlint).
* Better error messages for JarState.
* Improved test harnessing.
* Formatter now has pluggable exception policies,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import com.diffplug.spotless.Provisioner;
import com.diffplug.spotless.ThrowingEx;

/** Wraps up [ktlint](https://github.com/shyiko/ktlint) as a FormatterStep. */
/** Wraps up [ktlint](https://github.com/pinterest/ktlint) as a FormatterStep. */
public class KtLintStep {
// prevent direct instantiation
private KtLintStep() {}
Expand Down
2 changes: 1 addition & 1 deletion plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
### Version 3.1.0 - February 27th 2017 ([javadoc](https://diffplug.github.io/spotless/javadoc/spotless-plugin-gradle/3.1.0/), [jcenter](https://bintray.com/diffplug/opensource/spotless-plugin-gradle/3.1.0))

* Added support for Scala via [scalafmt](https://github.com/olafurpg/scalafmt).
* Added support for Kotlin via [ktlint](https://github.com/shyiko/ktlint).
* Added support for Kotlin via [ktlint](https://github.com/pinterest/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.
Expand Down
4 changes: 2 additions & 2 deletions plugin-gradle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Spotless can check and apply formatting to any plain-text file, using simple rul
* Google's [google-java-format](https://github.com/google/google-java-format)
* [Groovy Eclipse](#groovy-eclipse)'s groovy code formatter
* [FreshMark](https://github.com/diffplug/freshmark) (markdown with variables)
* [ktlint](https://github.com/shyiko/ktlint)
* [ktlint](https://github.com/pinterest/ktlint)
* [scalafmt](https://github.com/olafurpg/scalafmt)
* [DBeaver sql format](https://dbeaver.jkiss.org/)
* [Prettier: An opinionated code formatter](https://prettier.io)
Expand Down Expand Up @@ -252,7 +252,7 @@ spotless {

<a name="ktlint"></a>

## Applying [ktlint](https://github.com/shyiko/ktlint) to Kotlin files
## Applying [ktlint](https://github.com/pinterest/ktlint) to Kotlin files

```gradle
spotless {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,17 @@
*/
package com.diffplug.gradle.spotless;

import static com.diffplug.spotless.kotlin.KotlinConstants.LICENSE_HEADER_DELIMITER;

import com.diffplug.spotless.FormatterStep;
import com.diffplug.spotless.kotlin.KtLintStep;
import java.util.Collections;
import java.util.Map;
import java.util.Objects;

import org.gradle.api.GradleException;
import org.gradle.api.file.FileCollection;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.SourceSet;

import com.diffplug.spotless.FormatterStep;
import com.diffplug.spotless.kotlin.KtLintStep;
import static com.diffplug.spotless.kotlin.KotlinConstants.LICENSE_HEADER_DELIMITER;

public class KotlinExtension extends FormatExtension implements HasBuiltinDelimiterForLicense {
static final String NAME = "kotlin";
Expand All @@ -46,7 +44,7 @@ public LicenseHeaderConfig licenseHeaderFile(Object licenseHeaderFile) {
return licenseHeaderFile(licenseHeaderFile, LICENSE_HEADER_DELIMITER);
}

/** Adds the specified version of [ktlint](https://github.com/shyiko/ktlint). */
/** Adds the specified version of [ktlint](https://github.com/pinterest/ktlint). */
public KotlinFormatExtension ktlint(String version) {
Objects.requireNonNull(version);
return new KotlinFormatExtension(version, Collections.emptyMap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public KotlinGradleExtension(SpotlessExtension rootExtension) {
super(rootExtension);
}

/** Adds the specified version of [ktlint](https://github.com/shyiko/ktlint). */
/** Adds the specified version of [ktlint](https://github.com/pinterest/ktlint). */
public KotlinFormatExtension ktlint(String version) {
Objects.requireNonNull(version, "version");
return new KotlinFormatExtension(version, Collections.emptyMap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void integration_default() throws IOException {
}

@Test
public void integration_shyiko() throws IOException {
public void integration_pinterest() throws IOException {
setFile("build.gradle").toLines(
"plugins {",
" id 'nebula.kotlin' version '1.0.6'",
Expand Down
2 changes: 1 addition & 1 deletion plugin-maven/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ By default, all files matching `src/main/kotlin/**/*.kt` and `src/test/kotlin/**
<endWithNewLine/>
<trimTrailingWhitespace/>
<ktlint>
<!-- Optional, available versions: https://github.com/shyiko/ktlint/releases -->
<!-- Optional, available versions: https://github.com/pinterest/ktlint/releases -->
<version>0.14.0</version>
</ktlint>
</kotlin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void testKtlint() throws Exception {
}

@Test
public void testKtlintShyiko() throws Exception {
public void testKtlintPinterest() throws Exception {
writePomWithKotlinSteps("<ktlint><version>0.21.0</version></ktlint>");

String path1 = "src/main/kotlin/main1.kt";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void behavior() throws Exception {
}

@Test
public void worksShyiko() throws Exception {
public void worksPinterest() throws Exception {
// Must use jcenter because `com.andreapivetta.kolor:kolor:0.0.2` isn't available on mavenCentral.
// It is a dependency of ktlint.
FormatterStep step = KtLintStep.create("0.31.0", TestProvisioner.jcenter());
Expand Down

0 comments on commit 3812713

Please sign in to comment.