Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Svistunov committed Apr 6, 2022
1 parent 07fd5fc commit 4c4eba7
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 13 deletions.
4 changes: 2 additions & 2 deletions RuleBase/Actively.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
extends: sequence
message: "Omit 'actively', if it precedes an action"
message: "Omit '%s', if it precedes an action"
description: "'Actively' is verbose when precedes a part of speech which implies an action."
level: warning
ignorecase: true
nonword: false
tokens:
- pattern: actively
- pattern: 'actively'
- skip: 2
- tag: VB|VBD|VBG|VBN|VBP|VBZ
action:
Expand Down
2 changes: 1 addition & 1 deletion RuleBase/Actual.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extends: existence
message: "Omit 'actual' in contracts"
message: "Omit '%s' in contracts"
description: "If 'actual' does not signal opposition to something alleged or potential, it may be unnecessary, in which case consider eliminating it."
nonword: false
level: warning
Expand Down
2 changes: 1 addition & 1 deletion RuleBase/AffirmativeAction.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extends: substitution
message: "'Affirmative' is redundant"
message: "Avoid verbosity"
description: "Use 'action' instead of verbose 'affirmative action'"
level: warning
ignorecase: true
Expand Down
1 change: 0 additions & 1 deletion RuleBase/AffirmativeCovenants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ description: "Use 'Positive Obligations' instead of the term of art 'Affirmative
<br><br><b>Warning:</b> legal terms of art became well accepted and have meanings well known to everyone who practices law. Be careful, as legal terms of art may have special meaning in particular context."
level: warning
#scope: heading
ignorecase: true
swap:
'(?:affirmative|positive) covenants': positive obligations
6 changes: 3 additions & 3 deletions RuleBase/Affirmatively.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
extends: sequence
message: "Omit 'affirmatively', if it precedes an action"
message: "Omit '%s', if it precedes an action"
description: "'Affirmatively' is verbose when precedes a part of speech which implies an action."
level: warning
ignorecase: true
nonword: false
tokens:
- pattern: affirmatively
- skip: 2
- pattern: 'affirmatively'
#skip: 2
- tag: VB|VBD|VBG|VBN|VBP|VBZ
action:
name: edit
Expand Down
19 changes: 15 additions & 4 deletions features/rules.feature
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Feature: Rules

Scenario Outline: Use of legal rules
Scenario Outline: Use of legal rules with single test phrase
When I test "<rule>"
Then the output should contain exactly:
"""
Expand All @@ -14,6 +14,17 @@ Feature: Rules
| Actively | 1:22 | Omit 'actively', if it precedes an action |
| Actual | 1:48 | Omit 'actual' in contracts |
| Actually | 1:40 | Avoid disagreement in contracts |
| AffirmativeAction | 1:10 | 'Affirmative' is redundant |
| AffirmativeCovenants | 1:15 | Avoid archaic language |
| Affirmatively | 1:13 | Omit 'affirmatively', if it precedes an action |
| AffirmativeAction | 1:10 | Avoid verbosity |
| Affirmatively | 1:13 | Omit 'affirmatively', if it precedes an action |

Scenario Outline: Use of legal rules with two test phrases
When I test "<rule>"
Then the output should contain exactly:
"""
test.md:<caretPositionFirst>:RuleBase.<rule>:<message>
test.md:<caretPositionSecond>:RuleBase.<rule>:<message>
"""

Examples:
| rule | caretPositionFirst | caretPositionSecond | message |
| AffirmativeCovenants | 1:15 | 2:15 | Avoid archaic language |
3 changes: 2 additions & 1 deletion fixtures/AffirmativeCovenants/test.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
The following Affirmative Covenants
The following Affirmative Covenants
The following Positive Covenants

0 comments on commit 4c4eba7

Please sign in to comment.