File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ From the command line::
5252 $ echo 'This are bad.' > example.txt
5353
5454 $ language-check example.txt
55- example.txt:1:1: THIS_NNS[3]: Did you mean 'these'?; suggestions: These
55+ example.txt:1:1: THIS_NNS[3]: Did you mean 'these'?
5656
5757
5858Installation
Original file line number Diff line number Diff line change @@ -123,14 +123,20 @@ def main():
123123 rule_id += '[{}]' .format (match .subId )
124124
125125 replacement_text = ', ' .join (match .replacements ).strip ()
126- print ('{}:{}:{}: {}: {}{}' .format (
126+
127+ message = match .msg
128+
129+ # Messages that end with punctuation already include the
130+ # suggestion.
131+ if replacement_text and not message .endswith (('.' , '?' )):
132+ message += '; suggestions: ' + replacement_text
133+
134+ print ('{}:{}:{}: {}: {}' .format (
127135 filename ,
128136 match .fromy + 1 ,
129137 match .fromx + 1 ,
130138 rule_id ,
131- match .msg ,
132- ('; suggestions: ' + replacement_text )
133- if replacement_text else '' ))
139+ message ))
134140 status = 2
135141
136142 return status
Original file line number Diff line number Diff line change @@ -8,4 +8,5 @@ echo 'This is okay.' | language-check -
88echo ' This is okay.' | python -m language_check -
99! echo ' This is noot okay.' | python -m language_check -
1010
11- ! echo ' This is a "dumb" quote.' | python -m language_check -
11+ echo ' These are “smart” quotes.' | python -m language_check -
12+ ! echo ' These are "dumb" quotes.' | python -m language_check -
You can’t perform that action at this time.
0 commit comments