Skip to content

Commit 2e6c768

Browse files
committed
Skip Go linting for plugins with no Go SDK
For example, plugins like LogExplorer that only provide frontend components (Explore views) don't have an sdk/go directory and should be skipped. Signed-off-by: Jeremy Rickards <jeremy.rickards@sap.com>
1 parent 80701e5 commit 2e6c768

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

scripts/golangci-lint/golangci-lint.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ func main() {
2525
var isError bool
2626

2727
for _, workspace := range npm.MustGetWorkspaces(".") {
28+
// skip plugin go validation if there is no Go SDK
29+
sdkGoPath := workspace + "/sdk/go"
30+
if _, err := os.Stat(sdkGoPath); os.IsNotExist(err) {
31+
logrus.Infof("skipping golangci-lint for %s (no Go SDK)", workspace)
32+
continue
33+
}
34+
2835
cmd := exec.Command("golangci-lint", "run")
2936
cmd.Dir = workspace
3037
cmd.Stdout = os.Stdout

0 commit comments

Comments
 (0)