Skip to content
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

improve formatting of generated tf code #474

Merged
merged 12 commits into from
May 18, 2020
Merged

Conversation

ryanking
Copy link
Contributor

@ryanking ryanking commented May 18, 2020

Collapse all vertical whitespaces (runs of \n) in generated code to reduce the number of whitespace-only diffs that fogg generates.

Post 0.12 the terraform fmt command avoids managing vertical whitespace (ie newlines).

That decision combined with our use fo go templates, wherein is it at best annoying and at worse impossible to reliably manage vertical whitespace the way we want to means that we havegiven up on avoiding diffs with meaningless whitespace changes.

From here forward we will collapse all \n+ to \n in generated code. This will mostly only affect fogg.tf, which is exactly what we want.

Test Plan

  • CI
  • manually tested on shared-infra repo

References

@ryanking ryanking requested a review from edulop91 May 18, 2020 16:50
@ryanking ryanking marked this pull request as ready for review May 18, 2020 16:50
@ryanking ryanking requested a review from a team as a code owner May 18, 2020 16:50
@codecov-io
Copy link

codecov-io commented May 18, 2020

Codecov Report

Merging #474 into master will increase coverage by 0.09%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #474      +/-   ##
==========================================
+ Coverage   61.12%   61.22%   +0.09%     
==========================================
  Files          19       19              
  Lines        1955     1960       +5     
==========================================
+ Hits         1195     1200       +5     
  Misses        607      607              
  Partials      153      153              
Impacted Files Coverage Δ
apply/apply.go 64.02% <83.33%> (+0.65%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 46ae83f...71e5be5. Read the comment docs.

@czimergebot czimergebot merged commit 12f8038 into master May 18, 2020
@czimergebot czimergebot deleted the ryanking/fmt-vertical branch May 18, 2020 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants