Add golangci-lint for linting and refactor the code based on the
feedback from running it.
Changes:
- Add configuration for golangci-lint.
- Break the large function in create.go into smaller ones.
- Rename internal/templateFuncs to internal/templatefuncs to remove
upper case letters in the package name.
- Add a mage target for lint tests.
Use the default FlagSet to parse all the arguments and to set the
default help message for spruce. Arguments set after the subcommand are
still parsed by the subcommand's FlagSet.
The summaries for all subcommand are defined in one place in the main
function for consistency.
The internal/cmd.SpruceUsage function is replaced with the
spruceUsageFunc function in the main package which returns the usage
function which is set as the default usage function.
The format of the help message for spruce and the subcommands have been
updated with the inspiration of the help message from gopass.
- Use go generate and a third party tool called jsonschemagen to
auto-generate the CV data type from the JSON schema.
- Update the schema by changing number to integer to ensure that the
integers are set to the correct type.
- Refactor some code.
Improve spruce-docgen by improving how additionalProperties is
unmarshalled. If the value is either true or false then
AdditionalProperties is set to the default schema value.
Update getType to return discovered maps.
Update refType to return UNKNOWN if the ref string is invalid.
Regenerated docs/schema.asciidoc