mirror of https://github.com/zulip/zulip.git
lint: Ban use of datetime.(utc)now in Python backend.
This may be all we're doing for #3999, but leaving it open just in case.
This commit is contained in:
parent
c5ba4e11d4
commit
342a80c3de
|
@ -411,6 +411,11 @@ def build_custom_checkers(by_lang):
|
|||
'include_only': set(["/migrations/"]),
|
||||
'description': "Don't import models in migrations; see docs/schema-migrations.md for solution",
|
||||
},
|
||||
{'pattern': 'datetime[.](now|utcnow)',
|
||||
'include_only': set(["zerver/", "analytics/"]),
|
||||
'description': "Don't use datetime in backend code.\n"
|
||||
"See https://zulip.readthedocs.io/en/latest/code-style.html#naive-datetime-objects",
|
||||
},
|
||||
# This rule might give false positives in virtualenv setup files which should be excluded,
|
||||
# and comments which should be rewritten to avoid use of "python2", "python3", etc.
|
||||
{'pattern': 'python[23]',
|
||||
|
|
Loading…
Reference in New Issue