errata-ai / vale

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.
https://vale.sh
MIT License
4.52k stars 155 forks source link

Add support for YAML #911

Closed dblock closed 1 month ago

dblock commented 1 month ago

Check for existing issues

Describe the feature

Coming from https://github.com/opensearch-project/opensearch-api-specification/issues/599 and an attempt to use Vale in https://github.com/opensearch-project/opensearch-api-specification/pull/620, we'd like to use Vale as a style guide for content in YAML files. Our YAML files are source code for an OpenAPI spec, so we would like to be able to say things like "only check the field called description".

(Could attempt to contribute with some pointers of where to start.)

kolchfa-aws commented 1 month ago

@dblock Seems that there is a similar closed issue, which contains a link to the blog with implementation options

jdkato commented 1 month ago

I think such processing of data-serialization formats is out of scope for Vale. https://github.com/errata-ai/vale/issues/383 is another related issue.

dblock commented 1 month ago

@jdkato That's surprising, Vale has support for things like Docbook XML for example, is this that different?

dblock commented 1 month ago

FYI in https://github.com/opensearch-project/opensearch-api-specification/pull/620 I pruned YAMLs from all markup leaving only text and ran vale on it with --ignore-syntax successfully. It's a bit hacky but it works. I think a generic way to pre-process structured content like YAML would make things easier to use.