feat(s2n-events): Pre-format generated events with prettyplease#3117
Open
Mark-Simulacrum wants to merge 1 commit into
Open
feat(s2n-events): Pre-format generated events with prettyplease#3117Mark-Simulacrum wants to merge 1 commit into
Mark-Simulacrum wants to merge 1 commit into
Conversation
rustfmt has longstanding bugs where long lines will be left unchanged after it runs. Unfortunately, proc-macro2's output has no way to insert a newline in TokenStreams (only if we're willing to change how we output in the first place), and we'd have to manually pepper inserting them. prettyplease is aimed to guarantee that it will always break such lines up, so the subsequent rustfmt pass is more reliable. Unexpectedly to me, prettyplease also 'prettifies' known attributes, e.g., doc comments are made into nice syntax rather than being left as attributes. Ultimately that seems maybe even an *improvement* over the status quo; it shouldn't have any meaningful effect on rustdoc output. The handling of some more nuanced formatting where there's no knowledge of the macro being invoked (e.g., tracing::event/span!) is a bit more dubious, but I think isn't horrible. This commit re-runs ./scripts/events. Notably this already fixes at least one pre-existing huge line (nominal_counter_offsets in dc aggregate metrics). I ran into this because adding more events was creatng more such cases where everything remains on one line. This should overall have no functional change.
ece5e07 to
c7ace5a
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Release Summary:
Resolved issues:
n/a
Description of changes:
rustfmt has longstanding bugs where long lines will be left unchanged after it runs. Unfortunately, proc-macro2's output has no way to insert a newline in TokenStreams (only if we're willing to change how we output in the first place), and we'd have to manually pepper inserting them. prettyplease is aimed to guarantee that it will always break such lines up, so the subsequent rustfmt pass is more reliable.
Call-outs:
Unexpectedly to me, prettyplease also 'prettifies' known attributes, e.g., doc comments are made into nice syntax rather than being left as attributes. Ultimately that seems maybe even an improvement over the status quo; it shouldn't have any meaningful effect on rustdoc output. The handling of some more nuanced formatting where there's no knowledge of the macro being invoked (e.g., tracing::event/span!) is a bit more dubious, but I think isn't horrible.
This commit re-runs ./scripts/events. Notably this already fixes at least one pre-existing huge line (nominal_counter_offsets in dc aggregate metrics). I ran into this because adding more events was creatng more such cases where everything remains on one line.
This should overall have no functional change.
Testing:
CI should confirm events are up to date.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.