-
Notifications
You must be signed in to change notification settings - Fork 309
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
Add command-line option to display provided name instead of "Combined" #257
Comments
@mark-rushakoff There are a few contexts which might require different behaviors and some thought will need to be given to what type of UX we'd like to see. Context A GIVEN: a yaml file with multiple documents and
the combined flag set to true
WHEN: a policy outputs results
THEN: we should see the specific file name the result
is for Context B GIVEN: multiple different files (.tf) and
the combined flag set to true
WHEN: a policy outputs results
THEN: we should see the specific file name the
results is for In Context A, we can output the filename no problem, as all of the things we are combining are from the same file. In Context B, its a little harder. This might be multiple YAMLs or multiple HCLs. In this context we can't always associate a file to a policy. By design this combine feature allows us to compare values across files. If we are comparing the values of multiple files in a given policy then which file will we output? ill use another Gherkin to clarify my thought :) Context C GIVEN: multiple different files (.tf) and
the combined flag set to true
WHEN: a policy compares values across N files
in our set of files and outputs results
THEN: we should see the specific file name
the result is for that last part we can say the behavior becomes: Option A
Option B
Option N: As previously stated more information makes for a more delightful user experience, so I agree we should explore some change here. |
Ran into this a couple times as well. This issue is also related to configurations that are passed via standard input (results in That said I would think something like: |
From offline discussions, we are leaning towards |
I am validating some YAML with
conftest test --combine FILE...
. But, I am invoking conftest from a script that is executed independently against multiple collections of files, so my output from this script looks like:Although I could update my script to print the filename as a header, that wouldn't port to other output formats. It would be better if I could provide something like
--combined-filename=x
, to instead get output like:The text was updated successfully, but these errors were encountered: