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

UnnecessaryAbstractClass: report only the class name #4808

Merged
merged 1 commit into from May 4, 2022

Conversation

t-kameyama
Copy link
Contributor

Fixes #4749

@github-actions github-actions bot added the rules label May 4, 2022
Comment on lines +188 to +194
@Test
fun `reports no abstract members in an abstract class with just a constructor parameter`() {
val code = "abstract class A(i: Int)"
val findings = subject.compileAndLintWithContext(env, code)
assertFindingMessage(findings, message)
assertThat(findings).hasSourceLocation(1, 16)
}
Copy link
Contributor Author

@t-kameyama t-kameyama May 4, 2022

Choose a reason for hiding this comment

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

This test covers the following lines

else ->
report(CodeSmell(issue, Entity.from(nameIdentifier), noAbstractMember))

@schalkms schalkms merged commit 61cfc24 into detekt:main May 4, 2022
@t-kameyama t-kameyama deleted the issue_4749 branch May 4, 2022 16:51
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.

UnnecessaryAbstractClass is not targeting class name
3 participants