mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
linter: Add rule to lint against use of typing.Text and promote str.
This commit is the last in a series of commits which migrated our entire codebase to use str instead of typing.Text. Fixes: #9203.
This commit is contained in:
committed by
Tim Abbott
parent
addfde7374
commit
64678b459c
@@ -515,6 +515,19 @@ def build_custom_checkers(by_lang):
|
|||||||
'bad_lines': ['desc = models.TextField() # type: Optional[Text]',
|
'bad_lines': ['desc = models.TextField() # type: Optional[Text]',
|
||||||
'stream = models.ForeignKey(Stream, on_delete=CASCADE) # type: Optional[Stream]'],
|
'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
|
]) + whitespace_rules + comma_whitespace_rule
|
||||||
bash_rules = cast(RuleList, [
|
bash_rules = cast(RuleList, [
|
||||||
{'pattern': '#!.*sh [-xe]',
|
{'pattern': '#!.*sh [-xe]',
|
||||||
|
|||||||
Reference in New Issue
Block a user