Skip to content

Commit

Permalink
feat(rule): preferred alternative for 0-day
Browse files Browse the repository at this point in the history
  • Loading branch information
naiyerasif committed Mar 18, 2024
1 parent 20a2ffa commit cd8d965
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compris/PreferredAlternatives.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: substitution
message: "Prefer '%s' over '%s'."
level: warning
ignorecase: true
action:
name: replace
swap:
0-day: zero-day
6 changes: 6 additions & 0 deletions fixtures/PreferredAlternatives/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StylesPath = ../../

MinAlertLevel = suggestion

[*.md]
compris.PreferredAlternatives = YES
4 changes: 4 additions & 0 deletions fixtures/PreferredAlternatives/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Preferred Alternatives

<!-- 0-day -->
A hacker forum was found selling a 0-day exploit for a popular web browser.
1 change: 1 addition & 0 deletions test/expectations/PreferredAlternatives.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test.md:4:36:compris.PreferredAlternatives:Prefer 'Zero-day' over '0-day'.

0 comments on commit cd8d965

Please sign in to comment.