-
Notifications
You must be signed in to change notification settings - Fork 1.7k
docs: add JSON schema section to bot configuration #1018
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,42 @@ can configure how you want `@all-contributors` to generate the list. | |
|
|
||
| > You are viewing the 🤖Bot Configuration, which is similar to the [CLI Configuration](/cli/configuration) | ||
|
|
||
| ## JSON Schema | ||
|
|
||
| You can validate your `.all-contributorsrc` configuration file using the JSON schema available on [SchemaStore](https://www.schemastore.org/all-contributors.json). | ||
|
|
||
| This helps in catching configuration errors early and provides auto-completion in compatible editors (like VS Code). | ||
|
|
||
| Example `.all-contributorsrc` with `$schema` added: | ||
|
|
||
| ```json | ||
| { | ||
|
Comment on lines
+19
to
+22
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a duplicate of the example file on the same page? I don't think it is necessary to write that twice.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay |
||
| "$schema": "https://www.schemastore.org/all-contributors.json", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this keyword is used in schema to specify which dialect is used. It might actually cause validation to fail as the schema doesn't expect this.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay |
||
| "projectName": "all-contributors", | ||
| "projectOwner": "all-contributors", | ||
| "repoType": "github", | ||
| "repoHost": "https://github.com", | ||
| "files": ["README.md"], | ||
| "imageSize": 100, | ||
| "commit": false, | ||
| "contributorsPerLine": 7, | ||
| "contributorsSortAlphabetically": false, | ||
| "badgeTemplate": "[](#contributors)", | ||
| "contributorTemplate": "<a href=\"<%= contributor.profile %>\"><img src=\"<%= contributor.avatar_url %>\" width=\"<%= options.imageSize %>px;\" alt=\"\"/><br /><sub><b><%= contributor.name %></b></sub></a>", | ||
| "wrapperTemplate": "\n<table>\n <tbody><%= bodyContent %> </tbody>\n<%= tableFooterContent %></table>\n\n", | ||
| "types": { | ||
| "custom": { | ||
| "symbol": "🔭", | ||
| "description": "A custom contribution type.", | ||
| "link": "[<%= symbol %>](<%= url %> \"<%= description %>\")," | ||
| } | ||
| }, | ||
| "linkToUsage": true, | ||
| "skipCi": true, | ||
| "contributors": [] | ||
| } | ||
| ``` | ||
|
|
||
| These are the keys you can specify: | ||
|
|
||
| | Option | Description | Example/Default | | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right place to put this documentation. It might be better as a new page in the specification section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, I'd do that.