镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

.editorconfig for ktlint. - #1041

Closed
uk-taniyama wants to merge 1 commit into
diffplug:mainfrom
uk-taniyama:ktlint-editorconfig
Closed

uk-taniyama wants to merge 1 commit into
diffplug:mainfrom
uk-taniyama:ktlint-editorconfig

Conversation

@uk-taniyama

Copy link
Copy Markdown
  • set .editorconfig fullpath: then use it.
    ktlint().userData([editorconfig: project.file(".editorconfig").absolutePath])

  • set "?": recursively search the closest .editorconfig
    ktlint().userData([editorconfig: "?"])

@nedtwigg

Copy link
Copy Markdown
Member

Thanks for a first shot at implementing #142. As noted in that issue, you need to capture the state of the .editorconfig file because this PR would break up-to-date checking as currently written.

Here's an example

final FileSignature configSignature;
State(String version, Provisioner provisioner, @Nullable File configFile) throws IOException {
String mavenCoordinate;
Matcher versionMatcher;
if ((versionMatcher = VERSION_PRE_2_0.matcher(version)).matches()) {
mavenCoordinate = MAVEN_COORDINATE_PRE_2_0;
} else if ((versionMatcher = VERSION_PRE_3_0.matcher(version)).matches()) {
mavenCoordinate = MAVEN_COORDINATE_PRE_3_0;
} else {
mavenCoordinate = MAVEN_COORDINATE;
}
this.jarState = JarState.from(mavenCoordinate + version, provisioner);
this.configSignature = FileSignature.signAsList(configFile == null ? Collections.emptySet() : Collections.singleton(configFile));

@uk-taniyama
uk-taniyama force-pushed the ktlint-editorconfig branch 3 times, most recently from bf43591 to 58d6247 Compare December 17, 2021 11:13
- set .editorcofig fullpath
ktlint().editorConfig(project.file(".editorconfig").absolutePath)

- set "?": recursively search the closest .editorconfig
ktlint().editorConfig("?")
@nedtwigg

Copy link
Copy Markdown
Member

The new stuff you pushed doesn't address my comment above. Very happy to merge something which fixes the .editorconfig issue, but in the future please don't force-push. Sloppy commits are fine, it's easier to review the changes without force-push.

@nedtwigg
nedtwigg changed the base branch from main-temp to main April 20, 2022 21:31
@nedtwigg

Copy link
Copy Markdown
Member

I think that #1218 makes this unnecessary.

@nedtwigg nedtwigg closed this Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants