-
Notifications
You must be signed in to change notification settings - Fork 366
Circular dependency issue #11207
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
base: main
Are you sure you want to change the base?
Circular dependency issue #11207
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -211,6 +211,32 @@ | |
| graph.nodes shouldHaveSize 3 | ||
| } | ||
|
|
||
| "deal with recursive cycles in dependencies" { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we keep my older #10083 instead, which fixes an existing test in this regard? |
||
| val scope = "CyclicScope" | ||
| val id1 = Identifier("NPM::mlly:1.8.0") | ||
| val id2 = Identifier("NPM::pkg-type:1.3.1") | ||
|
|
||
| val handler = object : DependencyHandler<Identifier> { | ||
Check warningCode scanning / detekt Reports multiple space usages Warning test
Unnecessary long whitespace
|
||
| override fun identifierFor(dependency: Identifier) = dependency | ||
|
|
||
| override fun dependenciesFor(dependency: Identifier) = when(dependency) { | ||
Check warningCode scanning / detekt Format signature to be single when possible, multiple lines otherwise. Warning test
Newline expected before expression body
Check warningCode scanning / detekt Reports spaces around keywords Warning test
Missing spacing after "when"
|
||
| id1 -> listOf(id2) | ||
| id2 -> listOf(id1) | ||
| else -> emptyList() | ||
| } | ||
|
|
||
| override fun linkageFor(dependency: Identifier) = PackageLinkage.STATIC | ||
|
|
||
| override fun createPackage(dependency: Identifier, issues: MutableCollection<Issue>) = | ||
| Package.EMPTY.copy(id = dependency) | ||
| } | ||
|
|
||
| DependencyGraphBuilder(handler) | ||
| .addDependency(scope, id1) | ||
| .addDependency(scope, id2) | ||
| .build() | ||
| } | ||
|
|
||
| "check for illegal references when building the graph" { | ||
| val depLang = createDependency("org.apache.commons", "commons-lang3", "3.11") | ||
| val depNoPkg = createDependency(NO_PACKAGE_NAMESPACE, "invalid", "1.2") | ||
|
|
||
Check warning
Code scanning / detekt
Reports code blocks that are not followed by an empty line Warning
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.
If we do this, do we then still need this
breakCycles()logic:ort/model/src/main/kotlin/utils/DependencyGraphBuilder.kt
Lines 493 to 497 in 60316b7