Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Metadata
ID:kotlin-code-style/max-line-len
Language: Kotlin
Severity: Notice
Category: Code Style
Description
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)
Seamless integrations. Try Datadog Code Security
Datadog Code Security
Try this rule and analyze your code with Datadog Code Security
How to use this rule
1
2
rulesets:- kotlin-code-style # Rules to enforce Kotlin code style.
Create a static-analysis.datadog.yml with the content above at the root of your repository
Use our free IDE Plugins or add Code Security scans to your CI pipelines