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

MaxChainedCallsOnSameLine fails on import statements. #5014

Closed
NickButcher1 opened this issue Jun 30, 2022 · 4 comments
Closed

MaxChainedCallsOnSameLine fails on import statements. #5014

NickButcher1 opened this issue Jun 30, 2022 · 4 comments

Comments

@NickButcher1
Copy link

NickButcher1 commented Jun 30, 2022

Expected Behavior

detekt should not report any errors.

Observed Behavior

detekt reports the following for every import statement with 6 or more dots.
MaxChainedCallsOnSameLine - [6 chained calls on a single line; more than 5 calls should be wrapped to a new l(...)] at

Steps to Reproduce

Update from 1.21.0-RC1 to 1.21.0-RC2 and add this config
MaxChainedCallsOnSameLine:
active: true
maxChainedCalls: 5

Context

Trying to enable the new MaxChainedCallsOnSameLine rule.

Your Environment

  • Version of detekt used: 1.21.0-RC2.
  • 7.4.2
  • Operating System and version: Windows 11.
@BraisGabin
Copy link
Collaborator

BraisGabin commented Jun 30, 2022

@dzirbel could you check this?

dzirbel added a commit to dzirbel/detekt that referenced this issue Jun 30, 2022
Fix issues where MaxChainedCallsOnSameLine would report long import and package directives, where a warning certainly isn't necessary.
@dzirbel
Copy link
Contributor

dzirbel commented Jun 30, 2022

Thanks for the report - this is definitely an issue (along with package directives) which should be easy enough to fix in #5020.

BraisGabin pushed a commit that referenced this issue Jul 2, 2022
Fix issues where MaxChainedCallsOnSameLine would report long import and package directives, where a warning certainly isn't necessary.
@TWiStErRob
Copy link
Contributor

TWiStErRob commented Jul 10, 2022

Sorry @BraisGabin, found it, didn't look deep enough 😅. I think this issue can be closed as the PR is merged.

@BraisGabin
Copy link
Collaborator

BraisGabin commented Jul 10, 2022

You are right! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants