Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Aimed at #18.
This is rather work-in-progress (missing unit tests, and I haven't been able to figure out how you integration-test this -- so it might actually be broken) but I was hoping for early feedback before I sink more time into this, in case you fundamentally disagree with the direction.
Essentially, this extends the config format to allow this construction:
A desugaring step propagates any options specified outside
"specs"
to each element that doesn't provide the same option, allowing common params to be specified only once. Finally, exactly one of"specs"
and"src_file"
must be specified at the top level. If"src_file"
is specified at the top level, it is effectively rewritten to"specs": {"src_file": "..."}
which has the same behavior.A PR is treated as multi-file if either it has multiple specs or any spec it does have is multi-file. This is intended to preserve existing behavior and URLs (since all existing
.pr-preview.json
have a single spec). Due to the complexity of the existing multi-file processor (Wattsi) and dealing with the potential for output file collisions, at present configs that would have a Wattsi config side-by-side with another spec are outright rejected, though this could be loosened with more work if necessary.