Skip to content

Commit 881f2b5

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

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+
schemasPath := workspace + "/schemas"
29+
if _, err := os.Stat(schemasPath); os.IsNotExist(err) {
30+
// No schemas, skip go validation
31+
logrus.Infof("skipping golangci-lint for %s (no schemas)", 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)