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

chore: add pre-commit formatters for toml and yaml #1002

Merged
merged 6 commits into from
Oct 19, 2023

Conversation

lobis
Copy link
Collaborator

@lobis lobis commented Oct 19, 2023

Added pretty formatters for yaml and toml after accidentaly formatting a file in another PR. The configuration should roughly follow our conventions and it can be further tuned.

I did not run the formatter in all files in order not to pollute the contribution history, I think the pre-commit bot should do it if possible.

@lobis lobis mentioned this pull request Oct 19, 2023
@lobis lobis requested review from agoose77 and jpivarski October 19, 2023 19:57
@lobis lobis marked this pull request as ready for review October 19, 2023 19:57
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we can format the YAML and the TOML. It's a big diff now, but future diffs will be smaller as a result.

Since this looks very straightforward, I'll just merge it as-is.

Comment on lines +38 to +44
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.11.0
hooks:
- id: pretty-format-toml
args: [--autofix]
- id: pretty-format-yaml
args: [--autofix, --indent, '2', --offset, '2']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it, this was the only change you put in by hand, and all of the YAML got formatted as a result.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

@jpivarski jpivarski enabled auto-merge (squash) October 19, 2023 20:19
@jpivarski jpivarski merged commit f422551 into main Oct 19, 2023
19 checks passed
@jpivarski jpivarski deleted the pre-commit-format-yaml branch October 19, 2023 20:30
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