feat: console help, examples and named loggers (SummerCMS v0.4.0)
Every command gets long help and examples, descriptions in imperative sentence case, and a warn-only TestCommandsDocumented over bonfire.CheckDocs. The plugin logs through a diary component logger instead of the process default logger. Requires SummerCMS v0.4.0; command names and flags unchanged.
This commit is contained in:
21
commands_documented_test.go
Normal file
21
commands_documented_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package menu
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user