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
Update documentation for TrailingComma rules #5513
Conversation
.gitignore
Outdated
@@ -166,3 +166,6 @@ target/ | |||
/website/docs/rules/*.md | |||
/website/static/kdoc | |||
/website/docs/gettingstarted/_cli-options.md | |||
|
|||
# Jenv | |||
.java-version |
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.
I'm unsure this should be .gitignored. I'm actually in favor of having a .java-version
in the root folder
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.
Yes but everyone's .java-version
content will be different depending on the exact minor/patch version
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.
Maybe open a separate PR for this? I'm otherwise happy to merge this PR.
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.
I agree that we should move this to another pr. This PR is the last thing that we need to release 1.22.0.
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.
Yes but everyone's .java-version content will be different depending on the exact minor/patch version
You should be able to have just the major version (like 11
) inside .java-version
and that will be picked up correctly by jenv
...ain/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/TrailingCommaOnDeclarationSite.kt
Outdated
Show resolved
Hide resolved
...g/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/TrailingCommaOnCallSite.kt
Outdated
Show resolved
Hide resolved
* | ||
* [Kotlin coding convention](https://kotlinlang.org/docs/coding-conventions.html#trailing-commas) recommends | ||
* trailing comma encourage the use of trailing commas at the declaration site and | ||
* leaves it at your discretion for the call site. |
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.
I think you'd suggested adding a reference to the Android style guide? Though that style guide doesn't say anything about trailing commas, so I expect we will get some issues raised.
Perhaps instead it can be made clear that the defaults match upstream ktlint.
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.
Will emphasize ktlint here
* | ||
* [Kotlin coding convention](https://kotlinlang.org/docs/coding-conventions.html#trailing-commas) recommends | ||
* trailing comma encourage the use of trailing commas at the declaration site and | ||
* leaves it at your discretion for the call site. |
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.
As above
…formatting/wrappers/TrailingCommaOnDeclarationSite.kt Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com>
…formatting/wrappers/TrailingCommaOnCallSite.kt Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com>
@chao2zhang can you address the comment of @BraisGabin and me about the |
@ActiveByDefault
, however I was running into runtime exception at multiple places across our codebase, hence I would leave it for the next PR.