-
-
Notifications
You must be signed in to change notification settings - Fork 823
Reimplement local idea integration - #2172 #2704
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
Conversation
| import org.gradle.api.tasks.TaskAction | ||
| import org.gradle.language.base.plugins.LifecycleBasePlugin | ||
|
|
||
| @CacheableTask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ The classDetektIdeaFormatTaskis using inheritance, consider using composition instead. DoesDetektIdeaFormatTaskwant to expose the complete interface (empty public interface) ofIdeaCommandLineTasksuch thatDetektIdeaFormatTaskcan be used whereIdeaCommandLineTaskis expected? Indicates inheritance. DoesDetektIdeaFormatTaskwant only some/part of the behavior exposed byIdeaCommandLineTask? Indicates Composition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mkohm it works :)
You could provide a link to the definition of LCOM everytime you write LCOM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woho! Now the question is, how useful is it?
I agree on the LCOM, a link could maybe be provided. I will add it to the list of enhancements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case it was a nice comment to make me think if extracting the common properties of the base class into an data class and introducing a function in the tasks applyFrom(dataClass) would allow users to reduce duplicate code.
val commonProps = DataClass(x, y, z)
tasks.register(DetektIdeaFormat) {
applyFrom(commonProps)
}
...However I think when the sub class uses all properties of the base class, the inspection should not report it.
Generated by 🚫 Danger Kotlin against c68fee4 |
|
Calling inspect.sh hangs for even 2h and format.sh crashes for me with "container already disposed" without doing anything. Tested with 2019 and 2020 versions... |
Basic ideas are:
DetektExtensionTodo:
IdeaCommandLineTaskproperties and a introduce an apply functionIdeaCommandLineTask.apply(IdeaExtension)to share configuration between idea tasks