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

fix(file generator): trim content #81

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

patzick
Copy link

@patzick patzick commented Oct 28, 2024

While generating code examples we read the whole file. Formatters like Prettier adds additional line at the end of these files. But when you import that content into a code block, the same formatter is removing it.
Trimming the file content is preventing from the regeneration of the examples when they haven't really changed :)

@patzick
Copy link
Author

patzick commented Nov 28, 2024

hey @pi0 !
Do you mind taking a look here and merging it? :)

@pi0
Copy link
Member

pi0 commented Nov 28, 2024

Would be nice to have an option like no-trim to opt-out, it might be intentionally needed.

@pi0 pi0 changed the title fix: trim content in file generator fix(file generator): trim content Nov 28, 2024
@patzick
Copy link
Author

patzick commented Nov 28, 2024

@pi0 sure, added 🙌

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@5f40acc). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #81   +/-   ##
=======================================
  Coverage        ?   75.12%           
=======================================
  Files           ?       17           
  Lines           ?      985           
  Branches        ?      131           
=======================================
  Hits            ?      740           
  Misses          ?      244           
  Partials        ?        1           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants