-
Notifications
You must be signed in to change notification settings - Fork 237
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
Additional formatting updates for config validation #899
Additional formatting updates for config validation #899
Conversation
// Provide a stable sort order for printed values | ||
keys := make([]string, 0, len(values)) | ||
for k := range values { | ||
keys = append(keys, k) |
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.
open to suggestion here; I didn't find a way to do this in place for the original map.
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 think this is fine - it's nice and explicit what's going on and we're not necessarily resource constrained here
Resolve some issues from CircleCI-Public#861 and CircleCI-Public#896 - Suppress some whitespace when verbose output is not enabled - Write to stderr again - Use "%v" instead of "%s" so that "number" in pipeline values gets printed correctly - Sort values to provide stable output order for pipeline values
d5ddf96
to
cb2d3e6
Compare
} | ||
sort.Strings(keys) |
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.
This is a nice improvement 👌🏼
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.
Great improvement, thanks a lot!
Checklist
=========
Internal Checklist
Changes
%v
instead of%s
so that "number" in pipeline values gets printed correctlyRationale
@elliotforbes sorry - I think one or both of us missed that
number
doesn't get printed out right when%s
is used vs%v
. This also moves most of the verbose output to stderr (esp. could be an issue for subcommands that output yaml otherwise). It also gets rid of the extra newline before validate output in the case where verbose output is not usedSee #860 for original context. Resolve some issues from #861 and #896
Considerations
Screenshots
============
Before
After
Here are some helpful tips you can follow when submitting a pull request:
main
.make build
in the repository root.make test
).--debug
flag is often helpful for debugging HTTP client requests and responses.make lint
). Note: This requires Docker to run inside a local job.