Skip to content

feat: add comment syntax for switching styles#772

Merged
jdkato merged 2 commits intovale-cli:v3from
ak-1:v3
Nov 4, 2024
Merged

feat: add comment syntax for switching styles#772
jdkato merged 2 commits intovale-cli:v3from
ak-1:v3

Conversation

@ak-1
Copy link
Contributor

@ak-1 ak-1 commented Feb 17, 2024

This is a follow-up to #748 with tests included.

Individual styles can be switched on and off:

<!-- vale StyleName1 = YES -->
<!-- vale StyleName2 = NO -->

For a rule to be effective both the rule and the style has to be enabled.

on and off is accepted in addition to YES and NO

<!-- vale StyleName1 = on -->
<!-- vale StyleName2 = off -->

Styles can be set (enabling them and switching off any other styles):

<!-- vale style = StyleName1 -->
<!-- vale styles = StyleName1, StyleName2 -->

Individual styles can be switched on and off:
```
<!-- vale StyleName1 = YES -->
<!-- vale StyleName2 = NO -->
```
For a rule to be effective both the rule and the style has to be enabled.

`on` and `off` is accepted in addition to `YES` and `NO`
```
<!-- vale StyleName1 = on -->
<!-- vale StyleName2 = off -->
```

Styles can be set (enabling them and switching off any other styles):
```
<!-- vale style = StyleName1 -->
<!-- vale styles = StyleName1, StyleName2 -->
```
@jdkato jdkato merged commit e6eec99 into vale-cli:v3 Nov 4, 2024
@jdkato
Copy link
Member

jdkato commented Nov 4, 2024

Thanks for your work here!

@ccoVeille
Copy link
Contributor

Thanks it's what I needed for some files

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

Successfully merging this pull request may close these issues.

3 participants