Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
myslak71 committed Aug 3, 2019
1 parent f2b2455 commit dd9232c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flake8_koles/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class KolesChecker:
"""Bad language checker class."""

name = 'flake8-koles'
options = None
options = optparse.Values()
swear_list_dir = '/data/swear_list'
version = __version__

Expand Down Expand Up @@ -78,13 +78,13 @@ def _get_bad_words(self) -> Set[str]:
return {
word
for word in data.decode().strip().split('\n')
if len(word) > self.options.ignore_shorties # type: ignore
if len(word) > self.options.ignore_shorties
}

def _get_swears_data(self) -> bytes:
"""Get swears data from languages present in the options."""
data = b''
for lang in self.options.lang: # type: ignore
for lang in self.options.lang:
file_path = f'{self.swear_list_dir}/{lang}.dat'
data += pkg_resources.resource_string(
__name__, file_path
Expand All @@ -101,7 +101,7 @@ def _get_file_content(self) -> List[str]:

def _censor_word(self, word: str) -> str:
"""Replace all letters but first with `*` if censor_msg option is True."""
if self.options.censor_msg: # type: ignore
if self.options.censor_msg:
return word[0] + '*' * (len(word) - 1)
return word

Expand Down

0 comments on commit dd9232c

Please sign in to comment.