diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index f548584c6b..b786ada982 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -515,6 +515,19 @@ def build_custom_checkers(by_lang): 'bad_lines': ['desc = models.TextField() # type: Optional[Text]', 'stream = models.ForeignKey(Stream, on_delete=CASCADE) # type: Optional[Stream]'], }, + {'pattern': '[\s([]Text([^\s\w]|$)', + 'exclude': set([ + # 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', + 'tools/linter_lib', + # TODO: Update our migrations from Text->str. + 'zerver/migrations/', + # thumbor is (currently) python2 only + 'zthumbor/', + ]), + 'description': "Now that we're a Python 3 only codebase, we don't need to use typing.Text. Please use str instead.", + }, ]) + whitespace_rules + comma_whitespace_rule bash_rules = cast(RuleList, [ {'pattern': '#!.*sh [-xe]',