test: Add a check for too long or badly reflowed docstrings

This ensures that docstring comments are wrapped to 80 chars. ffrank
seemed to be making this mistake far too often, and it's a silly thing
to look for manually. As it turns out, I've made it too, as have many
others. Now we have a test that checks for most cases. There are still a
few stray cases that aren't checked automatically, but this can be
improved upon if someone is motivated to do so.

Before anyone complains about the 80 character limit: this only checks
docstring comments, not source code length or inline source code
comments. There's no excuse for having docstrings that are badly
reflowed or over 80 chars, particularly if you have an automated test.
This commit is contained in:
James Shubin
2020-01-25 04:05:43 -05:00
parent 525e2bafee
commit f67ad9c061
73 changed files with 775 additions and 410 deletions

View File

@@ -43,11 +43,10 @@ func init() {
gapi.Register(Name, func() gapi.GAPI { return &GAPI{} }) // register
}
// GAPI implements the main langpuppet GAPI interface.
// It wraps the Puppet and Lang GAPIs and receives graphs from both.
// It then runs a merging algorithm that mainly just makes a union
// of both the sets of vertices and edges. Some vertices are merged
// using a naming convention. Details can be found in the
// GAPI implements the main langpuppet GAPI interface. It wraps the Puppet and
// Lang GAPIs and receives graphs from both. It then runs a merging algorithm
// that mainly just makes a union of both the sets of vertices and edges. Some
// vertices are merged using a naming convention. Details can be found in the
// langpuppet.mergeGraphs function.
type GAPI struct {
langGAPI gapi.GAPI // the wrapped lang entrypoint
@@ -66,9 +65,9 @@ type GAPI struct {
wg sync.WaitGroup // sync group for tunnel go routines
}
// CliFlags returns a list of flags used by this deploy subcommand.
// It consists of all flags accepted by lang and puppet mode,
// with a respective "lp-" prefix.
// CliFlags returns a list of flags used by this deploy subcommand. It consists
// of all flags accepted by lang and puppet mode, with a respective "lp-"
// prefix.
func (obj *GAPI) CliFlags(command string) []cli.Flag {
langFlags := (&lang.GAPI{}).CliFlags(command)
puppetFlags := (&puppet.GAPI{}).CliFlags(command)