-
-
Notifications
You must be signed in to change notification settings - Fork 783
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
False positive on rule UnnecessaryAbstractClass #727
Comments
Thanks for using detekt! |
Yep, it makes sense for now. |
I can do that. I think the type-resolution tag is sufficient. |
Got something similar that should not be flagged: abstract class Screenshots {
@get:Rule val demoModeRule = DemoModeRule()
@Before fun setUp() {
Screengrab.setDefaultScreenshotStrategy(UiAutomatorScreenshotStrategy())
tearDown()
}
@After fun tearDown() {
nukeSharedPreferences()
}
fun screenshot(name: String) {
Screengrab.screenshot(name, Screengrab.getDefaultScreenshotStrategy(), ConstantFileWritingScreenshotCallback(application()))
}
fun isUsingFastlane() = InstrumentationRegistry.getArguments().getString("isUsingFastlane")?.toBoolean() == true
private class ConstantFileWritingScreenshotCallback(applicationContext: Context) : FileWritingScreenshotCallback(applicationContext) {
override fun getScreenshotFile(screenshotDirectory: File, screenshotName: String) =
File(screenshotDirectory, "$screenshotName.png")
}
} There are multiple reasons:
|
@vanniktech Hmm, I'm a bit skeptical and want to raise some questions. Should detekt really include framework specific things (JUnit in your case)? I'm a bit worried that this leads to implementing different edge cases which are only relevant for a minor audience. |
I guess it should but I'm biased! |
Take for instance the following classes :
The class Oof is reported as being an
UnnecessaryAbstractClass
, because it only contains concrete methods. But in fact, because it inherits from Foo, it also have an abstract, unimplemented method (bar
).The text was updated successfully, but these errors were encountered: