-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Kotlinify codebase #1039
Kotlinify codebase #1039
Conversation
cc1d971
to
a81eaeb
Compare
- Remove unnecessary nullable types - Replace no-op method bodies with Unit - Convert to expression body - Replace if with when - Remove braces from 'when' entries - Remove braces from if statement - Convert to single line lambda - oneline if/returns - Replace 'contains' call with 'in' operator Following this refactor, it could be great to envision a more "strict" code formatter like ktlint 1.0 (we are currently stuck at 0.48.1)
a81eaeb
to
caa482b
Compare
...n/com/google/samples/apps/nowinandroid/core/designsystem/component/scrollbar/ScrollbarExt.kt
Outdated
Show resolved
Hide resolved
...lin/com/google/samples/apps/nowinandroid/feature/bookmarks/navigation/BookmarksNavigation.kt
Outdated
Show resolved
Hide resolved
...in/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/navigation/ForYouNavigation.kt
Outdated
Show resolved
Hide resolved
...lin/com/google/samples/apps/nowinandroid/feature/interests/navigation/InterestsNavigation.kt
Outdated
Show resolved
Hide resolved
...in/kotlin/com/google/samples/apps/nowinandroid/feature/foryou/navigation/ForYouNavigation.kt
Outdated
Show resolved
Hide resolved
...lin/com/google/samples/apps/nowinandroid/feature/interests/navigation/InterestsNavigation.kt
Outdated
Show resolved
Hide resolved
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.
Thanks very much for doing this. Idiomatic Kotlin is definitely nicer to read.
ktlint was merged in #1094 |
…nandroid/core/designsystem/component/scrollbar/ScrollbarExt.kt Co-authored-by: Don Turner <[email protected]>
…droid/feature/foryou/navigation/ForYouNavigation.kt
…nandroid/feature/bookmarks/navigation/BookmarksNavigation.kt
…nandroid/feature/interests/navigation/InterestsNavigation.kt
…droid/feature/search/navigation/SearchNavigation.kt
@dturner PTAL, all your comments have been addressed 🤓 |
@SimonMarquis I can't see any changes relating to the resolved changes - did you forget to push a commit? |
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.
Waiting on suggested changes to be addressed
Oh apologies @SimonMarquis, for some reason I was reviewing outdated files which didn't have those commits. |
Following this refactor, it could be great to envision a more "strict" code formatter like ktlint 1.0 (we are currently stuck at 0.48.1)