lint: Migrate typing.Text check to semgrep.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-11-16 17:39:23 -08:00
committed by Anders Kaseorg
parent e5779c1ca0
commit d0d8c358b3
5 changed files with 13 additions and 18 deletions

View File

@@ -360,16 +360,6 @@ python_rules = RuleList(
'bad_lines': ['desc: Optional[Text] = models.TextField()',
'stream: Optional[Stream] = models.ForeignKey(Stream, on_delete=CASCADE)'],
},
{'pattern': r'[\s([]Text([^\s\w]|$)',
'exclude': {
# We are likely to want to keep these dirs Python 2+3 compatible,
# since the plan includes extracting them to a separate project eventually.
'tools/lib',
# TODO: Update our migrations from Text->str.
'zerver/migrations/',
},
'description': "Now that we're a Python 3 only codebase, we don't need to use typing.Text. Please use str instead.",
},
{'pattern': 'exit[(]1[)]',
'include_only': {"/management/commands/"},
'description': 'Raise CommandError to exit with failure in management commands',