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 code style #7312

Closed
wants to merge 8 commits into from
Closed

Update code style #7312

wants to merge 8 commits into from

Conversation

wmontwe
Copy link
Member

@wmontwe wmontwe commented Nov 1, 2023

This updates Spotless 6.21.0 -> 6.22.0, Detekt 1.23.0 -> 1.23.3, Detekt Compose Rules 0.1.11 -> 0.3.2 and ktlint 0.50.0 -> 1.0.1.

Unfortunatelly ktlint from version 1.0.0 introduced breaking changes by switching from intellij_idea to ktlint_official as default code style and enabling a set of new rules by default. Some of the rules are not very compatible with our project and how Android Studio is able to format code. The problematic rules have been disabled for now.

The configuration has been altered to reduce the ammount of changes. But as the updated ktlint now properly checks for max_line_length some changes to previously missed code had to be done.

DevicePreviews have been renamed to PreviewDevices to follow Google's naming convention for @Preview annotations.

Depends on: #7311

@cketti
Copy link
Member

cketti commented Nov 2, 2023

Did you use spotlessApply to reformat the code? Some lines that don't exceed 120 characters have been reformatted. Maybe there's a bug in there somewhere?

Base automatically changed from update_dependencies to main November 3, 2023 10:51
@wmontwe
Copy link
Member Author

wmontwe commented Nov 3, 2023

The spotlessApply tripped over several places where it wasn't able to automatically apply the formatting rules. Mostly max-line-length but also other issues. I had to fix them manually. Once done I run spotlessApply to fix the remaining issues automatically or disabled some of the new rules.

There have been some cases where it complained about max-line-length but it was just very close to 120 characters.

When I was running spotlessApply without rules updated I got > 1k files changed, so maybe there are some cases left in this changeset that are unnecessary.

@wmontwe
Copy link
Member Author

wmontwe commented Nov 7, 2023

close this in favor of #7328 and #7326

@wmontwe wmontwe closed this Nov 7, 2023
@wmontwe wmontwe deleted the update_code_style branch November 7, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants