Migrate from Ktlint to Ktfmt#1003
Conversation
This looks unrelated. |
Summary of ChangesHello @Goooler, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request migrates the project from Ktlint to Ktfmt for Kotlin code formatting. This change ensures that the codebase adheres to Block's engineering standards, promoting consistency and readability. The update involves modifying the Spotless plugin configuration, updating dependencies, and reformatting the code. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request migrates the project's code style from Ktlint to Ktfmt. The changes are extensive and affect numerous files, primarily involving code formatting adjustments. I've reviewed the changes across all modified files, including build scripts and source code. The switch to ktfmt in the build.gradle.kts and the removal of ktlint configurations in .editorconfig are correctly implemented. The formatting changes in the Kotlin source files are consistent with ktfmt's style and improve code consistency. I also noticed the removal of several unused imports, which is a good cleanup. Overall, this is a solid refactoring, and I don't see any issues. The changes look good to merge.
Yeah definitely unrelated. Secrets in the repo are only available to listed contributors. Is there a way to get ktfmt to match the existing style? Some changes it makes that I'm not fond of:
|
|
There are no additional rules that we can configure. I don't like some of them either, but it's a trend that we have to accept. |
|
I would suggest using |
| extension: CommonExtension<*, *, *, *, *, *>, | ||
| ) = extension.apply { | ||
| compileSdk = 36 | ||
| /** Sets common values for Android Applications and Libraries */ |
There was a problem hiding this comment.
This is enforced by Ktfmt.
|
Now is the time to push this, given facebook/ktfmt#616. |
|
@Goooler hey! yeah I also heard about this at kotlinconf. I want to wait until it is moved to the official kotlin repo, its supposed to have a few extra configuration options then. The one I really want is to stop making short lambdas single line. |
|
Yeah. I guess so. |
|
FYI, the single line lambda rule enforcement has been opted out in |
https://engineering.block.xyz/blog/adopting-ktfmt-and-detekt