-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/filetypes: better checking of filetype-dependent tags
Currently the filetypes logic allows arbitrary key-value pairs to be specified with no checking. It also assumes that all tags are equally valid to specify at the top level. Enhance the logic to allow any given tag to specify additional tags that can be specified when the tag is active, including key-value pairs. As well as key-value pairs, it's useful to have boolean flags, so add a field to `build.File` that allows those to be specified too. A slightly different approach might be to continue to use File.Tags but to have some mechanism in internal/filetypes to indicate that a given tag is boolean, but that just seems to add more complexity: the string values would then need to be parsed in some way to be used. This change means that key-value pairs are now checked properly (for example, it's no longer possible to specify `lang=go` unless the `code` tag is in play). Also add some different strictness modes for jsonschema inside `internal/filetypes` to check that the new mechanism works, but we don't yet hook this up to the actual filetypes logic. Signed-off-by: Roger Peppe <[email protected]> Change-Id: Ica91c400d51db84c42ef4a48bd9bd0199a3bb33a Dispatch-Trailer: {"type":"trybot","CL":1200901,"patchset":9,"ref":"refs/changes/01/1200901/9","targetBranch":"master"}
- Loading branch information
Showing
5 changed files
with
100 additions
and
19 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
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
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
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
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