Replies: 5 comments 1 reply
-
|
Do you have an example file? It's hard for me to help without a little more information. |
Beta Was this translation helpful? Give feedback.
-
|
I can't give you an entire file but I can give you a representative section: We have Vale styles that we need to apply to the Thanks for any help. |
Beta Was this translation helpful? Give feedback.
-
|
You can create a custom file view that extracts those sections: engine: dasel
scopes:
- name: chapter.title
expr: chapters.all().title
- name: chapter.goal
expr: chapters.all().goal
# Long form content (`|-`) might contain markup?
type: md
- name: section.objective
# objectives can be empty
expr: chapters.all().topics.all().sections.all().objectives?.all()You can then write rules that target them individually: extends: existence
message: "'%s' should be capitalized"
scope: chapter.title
raw:
- "^[a-z].+"Or just let your default ( |
Beta Was this translation helpful? Give feedback.
-
|
Hello, I've been doing some tests with a view and it worked perfectly to check all of our rules on certain keys in the YAML file. However, I was missing a way to skip certain rules on certain keys of the YAML file (e.g. skip Vale.Spelling rule on metadata fields). Is there a way to achieve such behavior with views? I was able to achieve it by adding an optional ignore field to View scopes that allows specifying a list of rules to skip when linting specific YAML keys, but I'm unsure if there was already a way to do it. If not, I'd be happy to refine what I did and submit it so it can be considered for a future update. |
Beta Was this translation helpful? Give feedback.
-
|
@jdkato I just went ahead and created a PR with my changes. I guessed it would be easier to directly see what I did. Hope that is ok :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
vale version 3.12.0
Most of our content is written in adoc but we also use one YAML file for a range of headings, audience identification statements, and similar. I have Vale configured so that it is processing the YAML file, but I also have a couple of styles where I need to ignore titles. For adoc files, I use
scope: ~headingbut I can't work out the equivalent for YAML files.I've been following the info at https://github.com/errata-ai/vale/releases/tag/v3.11.0 but can't make it work. This is a pure YAML file. The
titleheadings appear at different levels for different sections, so that might be part of the problem.I'd really like to get this working because it's a big part of our linting process. Would love any pointers, suggestions, etc.
Thanks a lot.
David
Beta Was this translation helpful? Give feedback.
All reactions