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

Kotlinify codebase #1039

Merged
merged 9 commits into from
Dec 22, 2023
Merged

Kotlinify codebase #1039

merged 9 commits into from
Dec 22, 2023

Conversation

SimonMarquis
Copy link
Contributor

  • 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)

@SimonMarquis SimonMarquis force-pushed the kotlinify branch 6 times, most recently from cc1d971 to a81eaeb Compare November 21, 2023 18:12
- 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)
@SimonMarquis SimonMarquis marked this pull request as ready for review November 21, 2023 19:11
Copy link
Collaborator

@dturner dturner left a 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.

@dturner
Copy link
Collaborator

dturner commented Dec 21, 2023

it could be great to envision a more "strict" code formatter like ktlint 1.0 (we are currently stuck at 0.48.1)

ktlint was merged in #1094

SimonMarquis and others added 5 commits December 21, 2023 18:45
…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
@SimonMarquis
Copy link
Contributor Author

@dturner PTAL, all your comments have been addressed 🤓

@SimonMarquis SimonMarquis requested a review from dturner December 21, 2023 17:53
@dturner
Copy link
Collaborator

dturner commented Dec 22, 2023

@SimonMarquis I can't see any changes relating to the resolved changes - did you forget to push a commit?

Copy link
Collaborator

@dturner dturner left a 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

@SimonMarquis
Copy link
Contributor Author

@dturner these commits are:

@dturner
Copy link
Collaborator

dturner commented Dec 22, 2023

Oh apologies @SimonMarquis, for some reason I was reviewing outdated files which didn't have those commits.

@dturner dturner merged commit 36cacbd into android:main Dec 22, 2023
4 checks passed
@SimonMarquis SimonMarquis deleted the kotlinify branch December 22, 2023 17:49
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