Skip to content

Commit

Permalink
Add mypy to the default whitelist (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
elromanos committed Feb 13, 2023
1 parent 6cbe2d0 commit 9146e80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions eradicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Eradicator(object):
r'noqa',
r'nosec',
r'type:\s*ignore',
r'mypy:',
r'fmt:\s*(on|off)',
r'yapf:\s*(enable|disable)',
r'isort:\s*(on|off|skip|skip_file|split|dont-add-imports(:\s*\[.*?\])?)',
Expand Down
9 changes: 9 additions & 0 deletions test_eradicate.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,15 @@ def test_comment_contains_code_with_default_whitelist(self):
self.assertFalse(eradicate.Eradicator().comment_contains_code(
'# type:ignore[import]'))

self.assertFalse(eradicate.Eradicator().comment_contains_code(
'# mypy: ignore-errors'))

self.assertFalse(eradicate.Eradicator().comment_contains_code(
'# mypy: disable-error-code=['))

self.assertFalse(eradicate.Eradicator().comment_contains_code(
'# mypy: warn-unreachable, strict-optional'))

self.assertFalse(eradicate.Eradicator().comment_contains_code(
'# TODO: Do that'))

Expand Down

0 comments on commit 9146e80

Please sign in to comment.