-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce a json schema file for yamlfmt
Docs: - https://github.com/google/yamlfmt/blob/main/docs/config-file.md - https://json-schema.org/ - https://json-schema.org/learn/getting-started-step-by-step#create-a-schema-definition Issue #181
- Loading branch information
Showing
1 changed file
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://raw.githubusercontent.com/google/yamlfmt/main/schema.json", | ||
"title": "yamlfmt config file", | ||
"description": "The yamlfmt config file. For details, see https://github.com/google/yamlfmt/blob/main/docs/config-file.md.", | ||
"type": "object", | ||
"properties": { | ||
"line_ending": { | ||
"type": "string", | ||
"enum": ["lf", "crlf"], | ||
"default": "lf", | ||
"description": "Parse and write the file with 'lf' or 'crlf' line endings. This global setting will override any formatter line_ending options." | ||
}, | ||
"doublestar": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "Use doublestar for include and exclude paths. (This was the default before 0.7.0)" | ||
}, | ||
"continue_on_error": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "Continue formatting and don't exit with code 1 when there is an invalid yaml file found." | ||
}, | ||
"include": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"default": [], | ||
"description": "The paths for the command to include for formatting. See Specifying Paths for more details." | ||
}, | ||
"exclude": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"default": [], | ||
"description": "The paths for the command to exclude from formatting. See Specifying Paths for more details." | ||
}, | ||
"gitignore_excludes": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "Use gitignore files for exclude paths. This is in addition to the patterns from the exclude option." | ||
}, | ||
"gitignore_path": { | ||
"type": "string", | ||
"default": ".gitignore", | ||
"description": "The path to the gitignore file to use." | ||
}, | ||
"regex_exclude": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"default": [], | ||
"description": "Regex patterns to match file contents for, if the file content matches the regex the file will be excluded. Use Golang regexes." | ||
}, | ||
"extensions": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"default": [], | ||
"description": "The extensions to use for standard mode path collection. See Specifying Paths for more details." | ||
}, | ||
"formatter": { | ||
"type": "object", | ||
"default": { | ||
"type": "basic" | ||
}, | ||
"description": "Formatter settings. See Formatter for more details.", | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"default": "basic" | ||
} | ||
}, | ||
"additionalProperties": { | ||
"type": "any" | ||
} | ||
}, | ||
"output_format": { | ||
"type": "string", | ||
"enum": ["default", "line"], | ||
"default": "default", | ||
"description": "The output format to use. See Output docs for more details." | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |