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

Update documentation for TrailingComma rules #5513

Merged
merged 5 commits into from Nov 18, 2022
Merged

Conversation

chao2zhang
Copy link
Member

.gitignore Outdated
@@ -166,3 +166,6 @@ target/
/website/docs/rules/*.md
/website/static/kdoc
/website/docs/gettingstarted/_cli-options.md

# Jenv
.java-version
Copy link
Member

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

Copy link
Member Author

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

Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Member

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

3flex
3flex approved these changes Nov 7, 2022
*
* [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.
Copy link
Collaborator

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.

Copy link
Member Author

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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

As above

chao2zhang and others added 2 commits November 7, 2022 19:15
…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>
@cortinico
Copy link
Member

@chao2zhang can you address the comment of @BraisGabin and me about the .java-version? Aside from this, we can merge this one 👍

@chao2zhang chao2zhang merged commit ab1c3c0 into main Nov 18, 2022
21 checks passed
@chao2zhang chao2zhang deleted the chao/trailingdefault branch November 18, 2022 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants