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

Refactor Kotlinify codebase (ktlint v.1.0.1) #91

Merged
merged 1 commit into from
Jan 22, 2024
Merged

Conversation

azrael8576
Copy link
Owner

@azrael8576 azrael8576 commented Jan 22, 2024

  • 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.1 (we are currently stuck at 0.48.1)

  • Include a PR description which states what you've done and why
  • Open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass (./gradlew --init-script gradle/init.gradle.kts spotlessApply to automatically apply formatting)

Are you a first-time contributor?

  • Ensure you've read and understood the contributing guidelines
  • Familiarize yourself with the project structure and the codebase

Fixes #90 🦕

- 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.1 (we are currently stuck at 0.48.1)
@azrael8576 azrael8576 added the enhancement New feature or request label Jan 22, 2024
@azrael8576 azrael8576 self-assigned this Jan 22, 2024
@azrael8576 azrael8576 changed the title Kotlinify codebase (#90) Refactor Kotlinify codebase (ktlint v.1.0.1) Jan 22, 2024
@azrael8576 azrael8576 marked this pull request as ready for review January 22, 2024 08:28
@azrael8576 azrael8576 merged commit d41e1f3 into main Jan 22, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR]: Refactor Kotlinify codebase (ktlint v.1.0.1)
1 participant