yamllint icon indicating copy to clipboard operation
yamllint copied to clipboard

feat: use editorconfig values if present

Open twelvelabs opened this issue 2 years ago • 2 comments

I'd love to have yamllint use EditorConfig for config defaults. Specifically:

  • indentation.spaces
  • line-length.max
  • new-line-at-end-of-file
  • new-lines.type
  • trailing-spaces

Currently I have to duplicate (and remember to keep in sync) those values in both .editorconfig and .yamllint.yaml.

Would you be open to a PR that adds editorconfig-core-py and uses .editorconfig for defaults if present?

twelvelabs avatar Oct 15 '22 18:10 twelvelabs

Hello,

In theory yamllint could try to read config files from many tools, e.g. Coala, MegaLinter, Prettier (.prettierrc), .vimrc, etc. and EditorConfig. I agree it would be a nice-to-have addition for some users, however like for many nice-to-have add-ons, it would be a burden for the project (especially if it requires adding a dependency), so I'd rather avoid maintaining it inside this repo.

Why about writing a small helper script that would generate a yamllint config file from a .editorconfig file?

adrienverge avatar Oct 18 '22 15:10 adrienverge

EditorConfig is becoming sufficiently omnipresent to support in itself.

hholst80 avatar Feb 10 '24 19:02 hholst80