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 Long Lines of Code for Improved Readability #213

Merged
merged 4 commits into from
Oct 20, 2024

Conversation

KesharwaniArpita
Copy link
Contributor

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:

  • Refactored methods and lines of code that exceeded the maximum line length.
  • Used string concatenation and multi-line formatting for better clarity and maintainability.

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

Copy link

github-actions bot commented Oct 20, 2024

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

  • The linting and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@andrewtavis andrewtavis added the hacktoberfest-accepted Accepted as a part of Hacktoberfest label Oct 20, 2024
Copy link
Member

@andrewtavis andrewtavis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, @KesharwaniArpita :) @angrezichatterbox and I did an autofix of the issues here 😊

We updated the docs on how to test code, so please run ./gradlew lintKotlin detekt in your terminal to test things locally for future PRs ✅

@andrewtavis andrewtavis merged commit 680f6f6 into scribe-org:main Oct 20, 2024
2 checks passed
@andrewtavis andrewtavis mentioned this pull request Oct 23, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Accepted as a part of Hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants