Skip to content

Commit

Permalink
add 'as amended' rule
Browse files Browse the repository at this point in the history
Signed-off-by: Artem.Svistunov <a.1.svistunov@gmail.com>
  • Loading branch information
Asv001 committed Apr 8, 2022
1 parent 0026296 commit 0fbc881
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
4 changes: 4 additions & 0 deletions RuleBase/.grazie.meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ rules:
name: "Inspection: number of arbitrators"
legal-specific: true

AsAmended:
name: "Verbosity: 'as amended'"
legal-specific: true

Contractions:
name: "Contractions in legal prose"
legal-specific: false
Expand Down
10 changes: 10 additions & 0 deletions RuleBase/AsAmended.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends: existence
message: "Avoid verbosity"
description: "Avoid verbosity in contracts, 'as amended' serves no purpose, consider eliminating it."
nonword: false
level: warning
action:
name: remove
tokens:
- ',? as amended,?'
- ',? as amended (from time to time)?,?'
14 changes: 14 additions & 0 deletions features/rules.feature
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,18 @@ Feature: Rules
test.md:170:1:RuleBase.PlainLegalEnglish:Use plainer word
test.md:171:1:RuleBase.PlainLegalEnglish:Use plainer word
test.md:172:1:RuleBase.PlainLegalEnglish:Use plainer word
"""

Scenario: Use of 'as amended'
When I test "AsAmended"
Then the output should contain exactly:
"""
test.md:3:25:RuleBase.AsAmended:Avoid verbosity
test.md:4:25:RuleBase.AsAmended:Avoid verbosity
test.md:5:25:RuleBase.AsAmended:Avoid verbosity
test.md:6:25:RuleBase.AsAmended:Avoid verbosity
test.md:8:25:RuleBase.AsAmended:Avoid verbosity
test.md:9:25:RuleBase.AsAmended:Avoid verbosity
test.md:10:25:RuleBase.AsAmended:Avoid verbosity
test.md:11:25:RuleBase.AsAmended:Avoid verbosity
"""
6 changes: 6 additions & 0 deletions fixtures/AsAmended/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StylesPath = ../../

MinAlertLevel = suggestion

[*.md]
RuleBase.AsAmended = YES
11 changes: 11 additions & 0 deletions fixtures/AsAmended/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Valid

according to the Charter as amended
according to the Charter, as amended,
according to the Charter, as amended
according to the Charter as amended,

according to the Charter as amended from time to time
according to the Charter, as amended from time to time,
according to the Charter as amended from time to time,
according to the Charter, as amended from time to time

0 comments on commit 0fbc881

Please sign in to comment.