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

yaml formatting/linting #3164

Open
jakkdl opened this issue Dec 22, 2024 · 1 comment
Open

yaml formatting/linting #3164

jakkdl opened this issue Dec 22, 2024 · 1 comment

Comments

@jakkdl
Copy link
Member

jakkdl commented Dec 22, 2024

breaking out from #3157

in flake8-async we've been using https://github.com/jumanjihouse/pre-commit-hook-yamlfmt for a while, but it mostly just handles indentation.

Looking around a bit I found yamllint, which has rules for quoting - with sufficient complexity it should satisfy @webknjaz (#3157 (comment))
https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.quoted_strings

Neither of the above tools can enforce block- vs flow-style arrays, but I found https://lyz-code.github.io/yamlfix/#sequence-list-style

yamlfix also has some quote rules: https://lyz-code.github.io/yamlfix/#quote-basic-values

tl;dr: yamlfix should be good

@webknjaz
Copy link
Member

Yeah, I tend to use yamllint (it can be integrated into pre-commit natively). But I don't normally change many defaults. Typically, I just set the sequences not to have extra indents. The quotes toggle seems interesting, but I haven't tried it out myself.

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

No branches or pull requests

2 participants