Default KtlintModule to .editorconfig explicitly - #3966
Merged
Conversation
lihaoyi
reviewed
Nov 14, 2024
| None | ||
| Some(PathRef(millSourcePath / ".editorconfig")) | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
How about defaulting to Task.workspace / ".editorconfig"? I'd guess most folks would have the config file at the root of their project (which is what Task.workspace is) rather than in each module's subfolder
Contributor
Author
|
Sounds great. I'm offline now. Feel free to change it now or I'll handle
it tomorrow when I'm up.
…On Fri, Nov 15, 2024, 02:44 Li Haoyi ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In kotlinlib/src/mill/kotlinlib/ktlint/KtlintModule.scala
<#3966 (comment)>:
> @@ -32,14 +32,14 @@ trait KtlintModule extends JavaModule {
* Ktlint configuration file.
*/
def ktlintConfig: T[Option[PathRef]] = Task {
- None
+ Some(PathRef(millSourcePath / ".editorconfig"))
}
How about defaulting to Task.workspace / ".editorconfig"? I'd guess most
folks would have the config file at the root of their project (which is
what Task.workspace is) rather than in each module's subfolder
—
Reply to this email directly, view it on GitHub
<#3966 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAP4ANC66X4X73HRHAHDUEL2ATVRDAVCNFSM6AAAAABRZQHHNSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDIMZWHEZTQNRYGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
lihaoyi
added a commit
that referenced
this pull request
Nov 15, 2024
* [x] Needs #3919 as this builds on it * [x] Update this to use #3961, switching to `KtlintModule` * [x] Needs #3966 to disable ktlint for some files Last change I think needed for #3829 Overview: * Changes `KtfmtModule` to set the error code when there's changes like is true of the other formatters. * Some simplifications were made to the `example/package.mill` based on similarities with Java/Kotlin. * Files were formatted * CI was updated --------- Co-authored-by: Li Haoyi <haoyi.sg@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For some reason
ktlintbehaves differently if it's config is set vs unset to it's default of.editorconfig.It seems to be unable to disable
ktlintwhen not explicitly set, so I think we should set it instead.Why not bump the version while we're at it?