-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Lint Kotlin examples #3923
base: main
Are you sure you want to change the base?
Lint Kotlin examples #3923
Conversation
test("testSimple") { | ||
generateHtml("hello") shouldBe "<h1>hello</h1>" | ||
} | ||
class FooTest : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't look like a reasonable change, but I don't know ktfmt
default rules. Overall, in the Kotlin ecosystem ktlint
is much more popular than ktfmt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just the default ktfmt
as there's no configuration. I'm guessing it's better to any formatter in place and we can let which the formatter battle to happen in parallel since it should then be a fairly easy switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then why not use ktlint
(as it is proposed in #3829) provided by KtlintModule
? It will require some changes to the run in the module-independent manner, but it will be easy to do by looking on KtfmtModule
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, it is ktlint
in the issue. I misread that. Forgive me, I am actually dyslexic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, let's try ktlint
and see how it looks. Then we can pick the one that looks better.
I noticed KtlintModule
does not have the companion object extends External Module
that the other autoformatters do, making it more annoying to use ad-hoc. We should probably add such an companion external module. KtfmtModule
, ScalafmtModule
, and PalantirFormatModule
can be used as a reference as to how it is done
I think I need to adjust the linter tests bc I've changed the implementation. Or change the default to not see the status code. |
Last change I think needed for #3829
Overview:
KtfmtModule
to set the error code when there's changes like is true of the other formatters.example/package.mill
based on similarities with Java/Kotlin.KtfmtModule
tests need updating as they aren't running cleanly from main on mymachine
.