Skip to content

Commit a544a42

Browse files
committed
Sort and keep unique misspelled words with option -m/--only-misspelled
1 parent 9a767fc commit a544a42

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

ChangeLog.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
:lang: en
55

66

7+
== Version 2.8 (under dev!)
8+
9+
* sort and keep unique misspelled words with option -m/--only-misspelled
10+
711
== Version 2.7 (2014-06-28)
812

913
* add argument id/str for -s/--spelling to check messages or translations

msgcheck/msgcheck.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ def main():
134134
total_errors += len(reports)
135135
if not args.quiet:
136136
if args.only_misspelled:
137-
print('\n'.join([report.message for report in reports
138-
if report.idmsg.startswith('spelling-')]))
137+
words = [report.message for report in reports
138+
if report.idmsg.startswith('spelling-')]
139+
print('\n'.join(sorted(set(words),
140+
key=lambda s: s.lower())))
139141
else:
140142
print('\n'.join([str(report) for report in reports]))
141143
else:

0 commit comments

Comments
 (0)