Skip to content

Commit

Permalink
feat(GoDep)!: Use the definition file path as fallback project name
Browse files Browse the repository at this point in the history
If the project name cannot be determined from the VCS, use the path of
the definition file relative to the analysis root as fallback project
name. This reduces the risk of identifier conflicts if there are
GoDep projects in different directories with the same name.

Signed-off-by: Martin Nonnenmacher <[email protected]>
  • Loading branch information
mnonnenmacher committed Feb 23, 2023
1 parent 60eaf71 commit d0f9e69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion analyzer/src/main/kotlin/managers/GoDep.kt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class GoDep(
.filterNot { it.isEmpty() }
.joinToString(separator = "/")
.lowercase()
}.getOrDefault(projectDir.name)
}.getOrDefault(getFallbackProjectName(analysisRoot, definitionFile))

// TODO Keeping this between scans would speed things up considerably.
gopath.safeDeleteRecursively(force = true)
Expand Down

0 comments on commit d0f9e69

Please sign in to comment.