Improve spell-checker case-sensitivity.
This only checks case-insensitively for the first char, so things like "QMouseEvent" don't trigger the check.
This commit is contained in:
parent
def41e70bf
commit
5a73ad0c19
@ -71,16 +71,17 @@ def check_git():
|
|||||||
def check_spelling():
|
def check_spelling():
|
||||||
"""Check commonly misspelled words."""
|
"""Check commonly misspelled words."""
|
||||||
# Words which I often misspell
|
# Words which I often misspell
|
||||||
words = {'behaviour', 'quitted', 'likelyhood', 'sucessfully',
|
words = {'[Bb]ehaviour', '[Qq]uitted', 'Ll]ikelyhood', '[Ss]ucessfully',
|
||||||
'occur[^r .]', 'seperator', 'explicitely', 'resetted',
|
'[Oo]ccur[^r .]', '[Ss]eperator', '[Ee]xplicitely', '[Rr]esetted',
|
||||||
'auxillary', 'accidentaly', 'ambigious', 'loosly',
|
'[Aa]uxillary', '[Aa]ccidentaly', '[Aa]mbigious', '[Ll]oosly',
|
||||||
'initialis', 'convienence', 'similiar', 'uncommited',
|
'[Ii]nitialis', '[Cc]onvienence', '[Ss]imiliar', '[Uu]ncommited',
|
||||||
'reproducable'}
|
'[Rr]eproducable'}
|
||||||
|
|
||||||
# Words which look better when splitted, but might need some fine tuning.
|
# Words which look better when splitted, but might need some fine tuning.
|
||||||
words |= {'keystrings', 'webelements', 'mouseevent', 'keysequence',
|
words |= {'[Kk]eystrings', '[Ww]ebelements', '[Mm]ouseevent',
|
||||||
'normalmode', 'eventloops', 'sizehint', 'statemachine',
|
'[Kk]eysequence', '[Nn]ormalmode', '[Ee]ventloops',
|
||||||
'metaobject', 'logrecord', 'filetype'}
|
'[Ss]izehint', '[Ss]tatemachine', '[Mm]etaobject',
|
||||||
|
'[Ll]ogrecord', '[Ff]iletype'}
|
||||||
|
|
||||||
seen = collections.defaultdict(list)
|
seen = collections.defaultdict(list)
|
||||||
try:
|
try:
|
||||||
@ -91,8 +92,8 @@ def check_spelling():
|
|||||||
continue
|
continue
|
||||||
for line in f:
|
for line in f:
|
||||||
for w in words:
|
for w in words:
|
||||||
if re.search(w, line, re.I) and fn not in seen[w]:
|
if re.search(w, line) and fn not in seen[w]:
|
||||||
print("Found '{}' in {}!".format(w, fn))
|
print('Found "{}" in {}!'.format(w, fn))
|
||||||
seen[w].append(fn)
|
seen[w].append(fn)
|
||||||
ok = False
|
ok = False
|
||||||
print()
|
print()
|
||||||
|
Loading…
Reference in New Issue
Block a user