Skip to content
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

Allow source only analysis #126

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions cmd/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,22 +414,23 @@ func (a *analyzeCommand) getConfigVolumes() (map[string]string, error) {
javaConfig.InitConfig[0].ProviderSpecificConfig["jvmMaxMem"] = Settings.JvmMaxMem
}

provConfig := []provider.Config{
{
Name: "go",
BinaryPath: "/usr/bin/generic-external-provider",
InitConfig: []provider.InitConfig{
{
Location: otherProvsMountPath,
AnalysisMode: provider.AnalysisMode(a.mode),
ProviderSpecificConfig: map[string]interface{}{
"name": "go",
"dependencyProviderPath": "/usr/bin/golang-dependency-provider",
provider.LspServerPathConfigKey: "/root/go/bin/gopls",
},
goConfig := provider.Config{
Name: "go",
BinaryPath: "/usr/bin/generic-external-provider",
InitConfig: []provider.InitConfig{
{
Location: otherProvsMountPath,
AnalysisMode: provider.FullAnalysisMode,
ProviderSpecificConfig: map[string]interface{}{
"name": "go",
"dependencyProviderPath": "/usr/bin/golang-dependency-provider",
provider.LspServerPathConfigKey: "/root/go/bin/gopls",
},
},
},
}

provConfig := []provider.Config{
javaConfig,
{
Name: "builtin",
Expand All @@ -441,6 +442,12 @@ func (a *analyzeCommand) getConfigVolumes() (map[string]string, error) {
},
},
}

// go provider only supports full analysis mode
if a.mode == string(provider.FullAnalysisMode) {
provConfig = append(provConfig, goConfig)
}

jsonData, err := json.MarshalIndent(&provConfig, "", " ")
if err != nil {
a.log.V(1).Error(err, "failed to marshal provider config")
Expand Down
Loading