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

Use ktfmt #290

Closed
jingtang10 opened this issue Mar 8, 2021 · 3 comments · Fixed by #294
Closed

Use ktfmt #290

jingtang10 opened this issue Mar 8, 2021 · 3 comments · Fixed by #294
Assignees
Labels

Comments

@jingtang10
Copy link
Collaborator

Start using https://github.com/facebookincubator/ktfmt

Under this issue please do the following

Thank you!

@jingtang10
Copy link
Collaborator Author

@deepankarb deepankarb self-assigned this Mar 8, 2021
@s-ayush2903
Copy link
Contributor

@deepankarb Should I give this issue a shot if you haven't started working on it yet, because I want to acquaint myself with the project codebase and therefore finding some ways to contribute and learn

@jingtang10
Copy link
Collaborator Author

Apologies @deepankarb and @s-ayush2903... I was just finishing #294 which I just linked here.

I've compared ktfmt, ktlint, and diktat. One really cool thing about spotless which we use is that you can use multiple linters (it's a linter aggregator). So we can totally use ktlint and ktfmt as well as diktat all together to benefit from their different strengths.

As an example, I've discovered that ktlint enforces the no-wildcard rule where ktfmt doesn't do anything about wildcards. So it's a good reason to keep ktlint.

But why ktfmt, and why the google-java-format? After experimenting with it, the rectangle rule among other things really stood out for me as a good exmaple of how this style guide produces really neat and readable code. The philosophy of ktfmt is also that the developer shouldn't worry about formatting, which is great.

I will update the developer's guide to add a section to configure the ktfmt plugin for AndroidStudio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants