This rule ensures that no line in your Kotlin code exceeds a certain maximum length, set to 140 characters by default. Exceeding this limit can lead to code that is difficult to read and understand, especially when working with complex codebases or reviewing code changes. It can also cause issues with version control systems that have difficulty handling long lines.
The rule take the argument max-line-length to adapt its behavior with your coding style and guidelines.
Non-Compliant Code Examples
valfooooooooooooooo="fooooooooooooooooooooo"valfoo="foo"+"ooooooooooooooooooooooooooo"valfoooooooooooooo="foooooooooooooooooooo"// some comment
valbad="fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"valfoooooooooooooo="foooooooooooooooooooo"// some comment
foo(bar,baz,bli,blo,foooooooooooooooooooo,foooooooooooooooooooo2,foooooooooooooooooooo3,foooooooooooooooooooo43)
valfooooooooooooooo="fooooooooooooooooooooo"valfoo="foo"+"ooooooooooooooooooooooooooo"valfoooooooooooooo="foooooooooooooooooooo"// some comment
foo(bar)
シームレスな統合。 Datadog Code Security をお試しください
Datadog Code Security
このルールを試し、Datadog Code Security でコードを解析する
このルールの使用方法
1
2
rulesets:- kotlin-code-style # Rules to enforce Kotlin code style.