Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaximumLineLength is ignored at function or line level #2179

Closed
dafi opened this issue Dec 15, 2019 · 1 comment · Fixed by #2191
Closed

MaximumLineLength is ignored at function or line level #2179

dafi opened this issue Dec 15, 2019 · 1 comment · Fixed by #2191

Comments

@dafi
Copy link
Contributor

dafi commented Dec 15, 2019

Expected Behavior

Declaring @Suppress("MaximumLineLength", "MaxLineLength") at function definition level should apply to the function/single line of code

Observed Behavior

The @Suppress is simply ignored but if declared at file level @file:Suppress("MaximumLineLength", "MaxLineLength") then the rules are applied

Steps to Reproduce

The example here reproduces the bug

Your Environment

  • Version of detekt used: 1.2.2
@dafi dafi changed the title MaxLineLength and MaximumLineLength are ignored at function or line level MaximumLineLength is ignored at function or line level Dec 15, 2019
@arturbosch
Copy link
Member

Sorry, unfortunately we can't support suppression on expression or statement level for rules not actually operating on the AST. This applies to rules from detekt-formatting and rules like MaximumLineLength.
I've added an extra sentence for the rule set documentation page for this.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants