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: don't count package references as chained calls #5036

Merged
merged 2 commits into from Jul 5, 2022

Conversation

t-kameyama
Copy link
Contributor

Fixes #5028

Copy link
Member

@BraisGabin BraisGabin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Test
fun `does not report 2 calls on a single line with a max of 3`() {
val rule = MaxChainedCallsOnSameLine(TestConfig(mapOf("maxChainedCalls" to 3)))
val code = "val a = 0.plus(0)"

assertThat(rule.compileAndLint(code)).isEmpty()
assertThat(rule.lintWithContext(env, code)).isEmpty()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use compileLintWithContext in all this cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BraisGabin BraisGabin added this to the 1.21.0 milestone Jul 5, 2022
@BraisGabin BraisGabin merged commit aa2a1bf into detekt:main Jul 5, 2022
@t-kameyama t-kameyama deleted the issue_5028 branch July 5, 2022 08:02
@TWiStErRob
Copy link
Member

Does this also fix import statements?

https://github.com/TWiStErRob/net.twisterrob.sun/security/code-scanning/275

@BraisGabin
Copy link
Member

That was fixed on other pr.

t-kameyama added a commit to t-kameyama/detekt that referenced this pull request Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MaxChainedCallsOnSameLine reports fully-qualified class names
4 participants