Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: config schema #109

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions schemas/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Cobra CLI settings",
"description": "Cobra CLI settings",
"type": "object",
"properties": {
"author": {
"title": "author",
"description": "An author of the project\nhttps://github.com/spf13/cobra-cli",
"type": "string",
"minLength": 1,
"pattern": "\\S",
"examples": ["Steve Francia <[email protected]>"]
},
"license": {
"title": "license",
"description": "A license of the project\nhttps://github.com/spf13/cobra-cli",
"oneOf": [
{
"type": "string",
"minLength": 1,
"pattern": "\\S",
"examples": [
"GPLv2",
"GPLv3",
"LGPL",
"AGPL",
"MIT",
"2-Clause BSD",
"3-Clause BSD"
]
},
{
"type": "object",
"properties": {
"header": {
"title": "header",
"description": "A header of the license\nhttps://github.com/spf13/cobra-cli",
"type": "string",
"minLength": 1,
"pattern": "\\S",
"examples": ["This file is part of CLI application foo."]
},
"text": {
"title": "text",
"description": "A text of the license\nVariables:\n- copyright\nhttps://github.com/spf13/cobra-cli",
"type": "string",
"minLength": 1,
"pattern": "\\S",
"examples": [
"{{ .copyright }}\n\nThis is my license. There are many like it, but this one is mine.\nMy license is my best friend. It is my life. I must master it as I must\nmaster my life.\n"
]
}
},
"additionalProperties": false
}
]
},
"useViper": {
"title": "use Viper",
"description": "Whether to use Viper (https://github.com/spf13/viper) for managing project configuration\nhttps://github.com/spf13/cobra-cli",
"type": "boolean"
}
},
"additionalProperties": false
}