CI / contracts (push) Canceled after 0s
Website / deploy (push) Canceled after 0s
CI / test (macos-latest) (push) Canceled after 0s
CI / test (ubuntu-24.04) (push) Canceled after 0s
CI / test (ubuntu-24.04-arm) (push) Canceled after 0s
CI / test (windows-latest) (push) Canceled after 0s
CI / Compact real-tool fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Compact real-tool fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / Code analysis fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Code analysis fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / Web engine fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Web engine fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / Chromium operation fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Chromium operation fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
CI / operation-readiness (push) Canceled after 0s
CI / Supply chain fixtures (ubuntu-24.04) (push) Canceled after 0s
CI / Supply chain fixtures (ubuntu-24.04-arm) (push) Canceled after 0s
26 lines
682 B
Go
26 lines
682 B
Go
package app
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func TestEveryCommandHasCompleteHelp(t *testing.T) {
|
|
root := NewCommand("test")
|
|
required := []string{"## Description", "## Purpose", "## Arguments", "## Examples", "## Expected Output", "## Output Schema", "## Limitations", "## Required Permissions", "## Related Commands", "## Common Mistakes", "## Best Practices"}
|
|
var walk func(*cobra.Command)
|
|
walk = func(c *cobra.Command) {
|
|
for _, heading := range required {
|
|
if !strings.Contains(c.Long, heading) {
|
|
t.Errorf("%s help missing %s", c.CommandPath(), heading)
|
|
}
|
|
}
|
|
for _, child := range c.Commands() {
|
|
walk(child)
|
|
}
|
|
}
|
|
walk(root)
|
|
}
|