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

Pretty yaml #170

Closed
wants to merge 1 commit into from
Closed

Pretty yaml #170

wants to merge 1 commit into from

Conversation

macisamuele
Copy link

As exists pretty-format-json I have added an equivalent hook for yaml files.
Since formatting of yaml files is heavily dependent on parameters passed to yaml.dump method I have decided to expose all the yaml.dump kwargs parameters in order to let the users of the hook to decide how a pretty YAML file looks like!

@asottile
Copy link
Member

yaml isn't round trippable so this hook isn't valid -- at best this will work for things which have no comments and no human decided formatting. At worst this will be a constant frustration for anyone trying to add comments / lists formatting / refs / any of the other features of yaml in the 72 page spec.

You can see (struggled) attempts to implement something like this: pre-commit/pre-commit#211 pre-commit/pre-commit#415

@macisamuele
Copy link
Author

@asottile++ I wasn't thinking about comments ... I'm closing the PR!

@asottile
Copy link
Member

<3 we've tried making this, and ran into the same things (why it doesn't exist!) :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants