Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.editorconfig for ktlint. #1041

Closed
wants to merge 1 commit into from

Conversation

uk-taniyama
Copy link

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