mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 22:02:17 +08:00
Make validate-schema CLI command work vs. disk (#36863)
* Make validate-schema CLI command work vs. disk Previously, `grafana-cli cue validate-schema` would only validate the CUE files that had been included at compile time. Now, the command requires passing a grafana checkout root path, and will actually check against live files on disk. * Exempt validateScuemata from sec linter * Nit: validateScuemata is a simpler, better name * Try to fix validate-scuemata build step
This commit is contained in:
@ -137,8 +137,18 @@ var adminCommands = []*cli.Command{
|
||||
var cueCommands = []*cli.Command{
|
||||
{
|
||||
Name: "validate-schema",
|
||||
Usage: "validate *.cue files in the project",
|
||||
Action: runPluginCommand(cmd.validateScuemataBasics),
|
||||
Usage: "validate known *.cue files in the Grafana project",
|
||||
Action: runPluginCommand(cmd.validateScuemata),
|
||||
Description: `validate-schema checks that all CUE schema files are valid with respect
|
||||
to basic standards - valid CUE, valid scuemata, etc. Note that this
|
||||
command checks only paths that existed when grafana-cli was compiled,
|
||||
so must be recompiled to validate newly-added CUE files.`,
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "grafana-root",
|
||||
Usage: "path to the root of a Grafana repository to validate",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "validate-resource",
|
||||
|
Reference in New Issue
Block a user