You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TrimMultilineRawString (#5051) rule can be helpfully extended to allow custom trimming functions and chained functions.
Expected Behavior
Here is an example from our codebase:
fun String.collapseWhitespace(text:String) =
trim().replace(Regex("\\s\\s+"), "")
val blockWithoutAnyExtraWhitespace =""" This is some text. Here is another line; spaced apart.""".collapseWhitespace()
println(blockWithoutAnyExtraWhitespace)
// Prints: This is some text. Here is another line; spaced apart.
Current Behavior
Currently the rule requires trimIndent() or trimMargin() be called and nothing else is considered valid.
Context
See above example from our codebase that fails this rule but we would like to be able to pass.
Configuration with this change would include an additional option:
Note: I'm working on another rule now for Hacktoberfest. If I actually get one done, I'll look into implementing this as well. Looks straightforward. Thanks for this great new rule!
The text was updated successfully, but these errors were encountered:
The
TrimMultilineRawString
(#5051) rule can be helpfully extended to allow custom trimming functions and chained functions.Expected Behavior
Here is an example from our codebase:
Current Behavior
Currently the rule requires
trimIndent()
ortrimMargin()
be called and nothing else is considered valid.Context
See above example from our codebase that fails this rule but we would like to be able to pass.
Configuration with this change would include an additional option:
Note: I'm working on another rule now for Hacktoberfest. If I actually get one done, I'll look into implementing this as well. Looks straightforward. Thanks for this great new rule!
The text was updated successfully, but these errors were encountered: