-
Notifications
You must be signed in to change notification settings - Fork 664
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 tool to generate formatting fixtures #1936
Add tool to generate formatting fixtures #1936
Conversation
f6338ea
to
725be20
Compare
aargh. galaxy seems to be on the fritz. |
Consider implementing this as a pytest plugin activated by a custom CLI option. |
@webknjaz done. I converted it to a "test" + pytest plugin. If |
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.
OK. I made a fix myself to keep using "after" in naming of formatting fixtures as we should not use implementation detail in them.
Keep in mind that we might start to format something else than yaml or to swap for another yaml library. The fact that we use ruamel-yaml is an implementation detail.
Works for me. Thanks for reviewing! |
Add tools/generate-formatting-fixtures.py which uses prettier to generate the fixture files.
Rename test/fixtures/formatting-after -> test/fixtures/formatting-prettier.
Add new test/fixtures/formatting-ruamel-yaml which is a copy of the prettier files for now.
In #1927, the diff will show where our ruamel.yaml formatter differs from prettier.
Also, add new fmt-2.yml formatting test fixture to cover a few more yaml oddities.