ModuleCheck icon indicating copy to clipboard operation
ModuleCheck copied to clipboard

new task: delete commented out dependencies

Open RBusarow opened this issue 3 years ago • 0 comments

If ModuleCheck is configured to remove dependencies via a comment instead of just deleting, then build file dependencies blocks are left looking like this:

dependencies {
  testFixturesApi(testFixtures(project(path = ":lib1")))
  // api(testFixtures(project(path = ":lib1")))  // ModuleCheck finding [unusedDependency]
  api(project(path = ":lib2"))
  // implementation(project(path = ":lib2"))  // ModuleCheck finding [mustBeApi]
}

When first introducing ModuleCheck to a codebase, it can be a good idea to start out with comments instead of deletion. This way, there are breadcrumbs everywhere to help in debugging any build issues.

In a big project, this can be a pain to clean up -- especially for people not comfortable with regex.

It may be a good idea to add a task -- moduleCheckCleanUpComments -- which goes through all the build files and removes all the comments which were created by the plugin.

RBusarow avatar Apr 22 '22 14:04 RBusarow