mirror of
https://github.com/codespell-project/codespell.git
synced 2025-08-06 01:36:26 +08:00
FIX: Caps and pytest (#482)
* FIX: Caps and pytest * FIX: Check in code * FIX: Check for unique names * FIX: Minor fixes * FIX: More checks
This commit is contained in:
@ -304,6 +304,10 @@ def build_dict(filename):
|
||||
with codecs.open(filename, mode='r', buffering=1, encoding='utf-8') as f:
|
||||
for line in f:
|
||||
[key, data] = line.split('->')
|
||||
# TODO for now, convert both to lower. Someday we can maybe add
|
||||
# support for fixing caps.
|
||||
key = key.lower()
|
||||
data = data.lower()
|
||||
if key in ignore_words:
|
||||
continue
|
||||
data = data.strip()
|
||||
@ -588,7 +592,7 @@ def main(*args):
|
||||
|
||||
dictionaries = options.dictionary or [default_dictionary]
|
||||
for dictionary in dictionaries:
|
||||
if dictionary is "-":
|
||||
if dictionary == "-":
|
||||
dictionary = default_dictionary
|
||||
if not os.path.exists(dictionary):
|
||||
print('ERROR: cannot find dictionary file: %s' % dictionary,
|
||||
|
Reference in New Issue
Block a user