From 4e15acf566d1d74c91d432b11e1a72178665d3a8 Mon Sep 17 00:00:00 2001 From: Christopher Poile Date: Mon, 22 Apr 2024 11:03:18 -0400 Subject: [PATCH] [MM-57855] Add manifest validation step (#198) --- Makefile | 7 ++++++- build/manifest/main.go | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dff7546..18e745a 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,11 @@ endif .PHONY: all all: check-style test dist +## Ensures the plugin manifest is valid +.PHONY: manifest-check +manifest-check: + ./build/bin/manifest check + ## Propagates plugin manifest information into the server/ and webapp/ folders. .PHONY: apply apply: @@ -56,7 +61,7 @@ install-go-tools: ## Runs eslint and golangci-lint .PHONY: check-style -check-style: apply webapp/node_modules install-go-tools +check-style: manifest-check apply webapp/node_modules install-go-tools @echo Checking for style guide compliance ifneq ($(HAS_WEBAPP),) diff --git a/build/manifest/main.go b/build/manifest/main.go index c57fe10..890414a 100644 --- a/build/manifest/main.go +++ b/build/manifest/main.go @@ -86,6 +86,11 @@ func main() { panic("failed to write manifest to dist directory: " + err.Error()) } + case "check": + if err := manifest.IsValid(); err != nil { + panic("failed to check manifest: " + err.Error()) + } + default: panic("unrecognized command: " + cmd) }