Skip to content

UnnecessaryAbstractClass: report only the class name#4808

Merged
schalkms merged 1 commit into
detekt:mainfrom
t-kameyama:issue_4749
May 4, 2022
Merged

UnnecessaryAbstractClass: report only the class name#4808
schalkms merged 1 commit into
detekt:mainfrom
t-kameyama:issue_4749

Conversation

@t-kameyama
Copy link
Copy Markdown
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
Copy Markdown
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