Skip to content

Commit e1d7e3a

Browse files
committed
Show rule in message
1 parent d6dcf17 commit e1d7e3a

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎language_check/main.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,16 @@ def main():
118118
print(lang_tool.correct(text))
119119
else:
120120
for match in lang_tool.check(text):
121+
rule_id = match.ruleId
122+
if match.subId is not None:
123+
rule_id += '[{}]'.format(match.subId)
124+
121125
replacement_text = ', '.join(match.replacements).strip()
122-
print('{}:{}:{}: {}{}'.format(
126+
print('{}:{}:{}: {}: {}{}'.format(
123127
filename,
124128
match.fromy + 1,
125129
match.fromx + 1,
130+
rule_id,
126131
match.msg,
127132
('; suggestions: ' + replacement_text)
128133
if replacement_text else ''))

‎test.bash‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ echo 'This is okay.' | language-check -
77

88
echo 'This is okay.' | python -m language_check -
99
! echo 'This is noot okay.' | python -m language_check -
10+
11+
! echo 'This is a "dumb" quote.' | python -m language_check -

0 commit comments

Comments
 (0)