golem:import-settings gets long help and examples, a description in sentence case without a trailing period, and a warn-only TestCommandsDocumented over bonfire.CheckDocs. A failed import is reported once (bonfire.Reported). Requires SummerCMS v0.4.0; the command name and its flag are unchanged.
22 lines
585 B
Go
22 lines
585 B
Go
package golem
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.golem15.com/golem15/summercms/modules/bonfire"
|
|
)
|
|
|
|
// TestCommandsDocumented logs every console command whose help lacks a
|
|
// description, long help, examples or an option description
|
|
// (bonfire.CheckDocs). It only warns: the framework's own coverage test
|
|
// fails on a gap, plugin repositories report it.
|
|
func TestCommandsDocumented(t *testing.T) {
|
|
commands := (&Plugin{}).Commands()
|
|
if len(commands) == 0 {
|
|
t.Fatal("the plugin declares no commands")
|
|
}
|
|
for _, problem := range bonfire.CheckDocs(commands) {
|
|
t.Logf("%s", problem)
|
|
}
|
|
}
|