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

Default KtlintModule to .editorconfig explicitly #3966

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

myyk
Copy link
Contributor

@myyk myyk commented Nov 14, 2024

For some reason ktlint behaves differently if it's config is set vs unset to it's default of .editorconfig.

It seems to be unable to disable ktlint when not explicitly set, so I think we should set it instead.

Why not bump the version while we're at it?

@myyk myyk mentioned this pull request Nov 14, 2024
3 tasks
@@ -32,14 +32,14 @@ trait KtlintModule extends JavaModule {
* Ktlint configuration file.
*/
def ktlintConfig: T[Option[PathRef]] = Task {
None
Some(PathRef(millSourcePath / ".editorconfig"))
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an Task.Input

@myyk
Copy link
Contributor Author

myyk commented Nov 14, 2024 via email

@lihaoyi lihaoyi merged commit 231ff64 into com-lihaoyi:main Nov 14, 2024
25 checks passed
@lefou lefou added this to the 0.12.3 milestone Nov 14, 2024
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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants