ruff
ruff copied to clipboard
Linting for yaml and toml file
Hey 👋
If I'm correct, there are not rules which target .yaml
or .toml
config files.
- Could be interesting to format also these types of files?
- Is this already a things?
I am sure they have a lot of work with Python rules, 677 open issues at that moment.
But, yes, would be nice to have yaml
, json
, toml
, xml
formatters included.
For example, I tried many different tools for autoformating xml
and almost all of them had some issues (or I had issues with configuring them), perhaps prettier was ok, but still not started using it, partially because of node.js
dependency.
Yeah that would be neat. It's not our primary focus for now. There's still a lot to do on the Python front.
Related to https://github.com/astral-sh/ruff/issues/9244
I am even thinking that pre-commit hook should have a check which will fail if you are trying to add a file of type which has no autoformatter configured )
@ashrub-holvi
I agree it would be nice if ruff could format/lint toml + yaml but it is possible to use prettier
for this without requiring node to be a project dependency. Just use the pre-commit hook and the pre-commit-ci.
Example https://github.com/great-expectations/great_expectations/blob/200c968b5b5c6b19d5d2d63ca0d6fe1835b94b62/.pre-commit-config.yaml#L27-L32
@Kilo59 yes, thanks, I know it't not a project dependency, in my case it was minor/temporary issue because of outdated node version in CI - upgrade was blocked by other stuff for some time. But still - less js is good )