Commit graph

9 commits

Author SHA1 Message Date
5445ad683a
added missing line break 2024-02-06 00:46:26 +00:00
1887436028
checkpoint: move all docs to docs folder for flow site support 2024-02-05 23:35:05 +00:00
71d62ecaf6
refactor: add golangci-lint with code refactoring
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.
2023-08-21 03:07:06 +01:00
4f90a4c8bb
fix: use default FlagSet for spruce help message
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.
2023-08-20 06:14:10 +01:00
9e0f5af2e6
fix: use JSON schema to auto-generate the CV type
- 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.
2023-08-18 23:47:41 +01:00
831e91a45d
fix: improve spruce-docgen
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
2023-08-18 15:13:17 +01:00
446691719f
small bit of refactoring; refType validate ref string 2023-08-18 14:21:36 +01:00
b92ab4e437
feat: add JSON schema and document generator
Add the schema for the CV JSON documentation and add an internal tool
called spruce-docgen that generates an AsciiDoc referencing the schema.
2023-08-17 21:51:53 +01:00
d0d03f48b7
chore: move main.go to cmd/spruce
In preparation for additional binaries that may or may
not appear.
2023-08-16 23:33:28 +01:00