Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ def match(self, filename):
if self.pattern_list is None:
return False

for p in self.pattern_list:
if fnmatch.fnmatch(filename, p):
return True

return False
return any(fnmatch.fnmatch(filename, p) for p in self.pattern_list)


class Misspelling:
Expand Down Expand Up @@ -507,9 +503,7 @@ def is_hidden(filename, check_hidden):
def is_text_file(filename):
with open(filename, mode='rb') as f:
s = f.read(1024)
if b'\x00' in s:
return False
return True
return b'\x00' not in s


def fix_case(word, fixword):
Expand Down