Skip to content

Default KtlintModule to .editorconfig explicitly - #3966

Merged
lihaoyi merged 2 commits into
com-lihaoyi:mainfrom
myyk:ktlint-config
Nov 14, 2024
Merged

Default KtlintModule to .editorconfig explicitly#3966
lihaoyi merged 2 commits into
com-lihaoyi:mainfrom
myyk:ktlint-config

Conversation

@myyk

@myyk myyk commented Nov 14, 2024

Copy link
Copy Markdown
Contributor

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
None
Some(PathRef(millSourcePath / ".editorconfig"))
}

Copy link
Copy Markdown
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
Copy Markdown
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

myyk commented Nov 14, 2024 via email

Copy link
Copy Markdown
Contributor Author

@lihaoyi
lihaoyi merged commit 231ff64 into com-lihaoyi:main Nov 14, 2024
@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 <haoyi.sg@gmail.com>
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