Escape whitespace and control characters in literals

Proprietary

Rewrites a String or char literal that spells out a control character, a tabulation or an invisible Unicode whitespace character so that it is written as \t, \b, \f or \uXXXX. Only the source spelling changes, so the value and the compiled class stay the same. In a text block every character is written as \uXXXX, and the incidental indentation and trailing whitespace the compiler strips are left alone, as are Kotlin-generated annotations and literals that escape a surrogate pair. Skips test sources.

io.moderne.staticanalysis.EscapeControlCharactersInLiterals
mod run . --recipe=io.moderne.staticanalysis.EscapeControlCharactersInLiterals

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.