From 342a80c3dee8000ea495834f93bfb06508351de3 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 8 Mar 2017 21:02:30 -0800 Subject: [PATCH] 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. --- tools/lint-all | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/lint-all b/tools/lint-all index ccf57397ab..50cd19df00 100755 --- a/tools/lint-all +++ b/tools/lint-all @@ -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]',