-
Notifications
You must be signed in to change notification settings - Fork 21
Add support for ignored dependencies #51
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
@@ -106,6 +106,7 @@ object GithubDependencyGraphPlugin extends AutoPlugin { | |||
val scalaBinaryVersion = (Keys.artifactName / Keys.scalaBinaryVersion).value | |||
val crossVersion = CrossVersion.apply(scalaVersion, scalaBinaryVersion) | |||
val allDirectDependencies = Keys.allDependencies.value | |||
val ignoredDependencies = Keys.state.value.attributes(githubSubmitInputKey).ignoredDependencies |
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 githubSubmitInputKey
attribute is set by the githubSubmitDependencyGraph
command here.
I suggest to add a default value, for the task not to fail if the attribute is missing:
val ignoredDependencies = Keys.state.value.attributes(githubSubmitInputKey).ignoredDependencies | |
val ignoredDependencies = Keys.state.value.attributes.get(githubSubmitInputKey).toSeq.flatMap(_.ignoredDependencies) |
@@ -137,7 +145,7 @@ object GithubDependencyGraphPlugin extends AutoPlugin { | |||
configReport <- report.configurations | |||
moduleReport <- configReport.modules | |||
moduleRef = getReference(moduleReport.module) | |||
if !moduleReport.evicted && !alreadySeen.contains(moduleRef) | |||
if !moduleReport.evicted && !alreadySeen.contains(moduleRef) && !isIgnored(moduleReport.module) |
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.
This will filter out the library but not its transitive dependencies. Maybe I am wrong but I think it would be quite hard to filter out all transitive dependencies of a library. To do so we would need to build the entire tree of parents and check that all roots are ignored. Unfortunately, in a module report we only have one level of parents: moduleReport.callers
.
What about filtering out entire configs rather than dependencies? That would be easier to implement.
A WIP for tackling #49 by allowing users to filter certain dependencies like scala3doc. Doesn't work yet as passing of the argument isn't implemented in a sot-compatible way.