Scribe-Android icon indicating copy to clipboard operation
Scribe-Android copied to clipboard

Linting issues due to line length

Open angrezichatterbox opened this issue 1 year ago • 0 comments

Terms

Description

Methods or lines of code that exceed the maximum allowed line length can be hard to read and maintain. To improve readability and maintainability, it is essential to ensure that lines do not exceed the maximum line length specified in the coding standards.

Before fixing:

fun someLongMethodName(param1: String, param2: Int, param3: Boolean): String {
    // This is an example of a method with lines exceeding the maximum length
    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."
}

After fixing:

fun someLongMethodName(param1: String, param2: Int, param3: Boolean): String {
    // Refactored method with lines within the maximum length
    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."
}

More about this can be understood from the docs

The lines to fix can be found out by:

  • Enable the MaxLineLength rule in your detekt.yml
  • Run the command ./gradlew detekt in the termianal
  • You would be able to see the lines where the errors occurs

Contribution

I would love to work on this and more than willing to help anyone solve this issue. :hap

angrezichatterbox avatar Sep 07 '24 09:09 angrezichatterbox