scribe-org / Scribe-Android

Android app with keyboards for language learners
GNU General Public License v3.0
41 stars 42 forks source link

Refactor Long Lines of Code for Improved Readability #213

Closed KesharwaniArpita closed 1 month ago

KesharwaniArpita commented 1 month ago

Contributor checklist


Description

This PR addresses the issue of lines of code exceeding the maximum allowed line length, as specified in our coding standards. Long lines can be hard to read and maintain, so I've refactored the relevant code to improve readability and adhere to the established guidelines.

Changes Made:

Example Before:

fun someLongMethodName(param1: String, param2: Int, param3: Boolean): String {
    val longString = "This is an example of a very long string that exceeds the maximum allowed line length and should be refactored to be more readable and maintainable."
}

Example After:

fun someLongMethodName(param1: String, param2: Int, param3: Boolean): String {
    val longString = "This is an example of a very long string that " +
                     "is now split into multiple lines to adhere " +
                     "to the maximum allowed line length and improve readability."
}

How to Verify: To ensure compliance with the maximum line length rule:

  1. Enable the MaxLineLength rule in the detekt.yml configuration file.
  2. Run ./gradlew detekt in the terminal to identify any remaining lines that violate the rule.

Additional Information: This change significantly enhances the code's readability and maintainability. The documentation provides more insights into the importance of this coding standard.

Related issue

github-actions[bot] commented 1 month ago

Thank you for the pull request!

The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Android rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you!

Maintainer checklist