diff options
author | Robert Hofer <1058012+hofrob@users.noreply.github.com> | 2023-02-08 22:26:06 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-02-08 22:59:25 +0100 |
commit | 70e2178dcaecdc4e90ac1cb45e06be261bd1e03b (patch) | |
tree | 6ca57dd3175e57b465eadacbaf1355e65f127f50 /doc/data | |
parent | 633cc9770226a5b9e815685d02db209baf2e0a61 (diff) | |
download | pylint-git-70e2178dcaecdc4e90ac1cb45e06be261bd1e03b.tar.gz |
doc for boolean-datetime
Diffstat (limited to 'doc/data')
-rw-r--r-- | doc/data/messages/b/boolean-datetime/bad.py | 8 | ||||
-rw-r--r-- | doc/data/messages/b/boolean-datetime/details.rst | 1 | ||||
-rw-r--r-- | doc/data/messages/b/boolean-datetime/good.py | 10 | ||||
-rw-r--r-- | doc/data/messages/b/boolean-datetime/pylintrc | 2 | ||||
-rw-r--r-- | doc/data/messages/b/boolean-datetime/related.rst | 1 |
5 files changed, 20 insertions, 2 deletions
diff --git a/doc/data/messages/b/boolean-datetime/bad.py b/doc/data/messages/b/boolean-datetime/bad.py new file mode 100644 index 000000000..c36abd1b1 --- /dev/null +++ b/doc/data/messages/b/boolean-datetime/bad.py @@ -0,0 +1,8 @@ +import datetime + +if datetime.time(): # [boolean-datetime] + print("It is time.") + + +if datetime.datetime.now().time(): # [boolean-datetime] + print("Now or never.") diff --git a/doc/data/messages/b/boolean-datetime/details.rst b/doc/data/messages/b/boolean-datetime/details.rst deleted file mode 100644 index ab8204529..000000000 --- a/doc/data/messages/b/boolean-datetime/details.rst +++ /dev/null @@ -1 +0,0 @@ -You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ ! diff --git a/doc/data/messages/b/boolean-datetime/good.py b/doc/data/messages/b/boolean-datetime/good.py index c40beb573..b846e0bd3 100644 --- a/doc/data/messages/b/boolean-datetime/good.py +++ b/doc/data/messages/b/boolean-datetime/good.py @@ -1 +1,9 @@ -# This is a placeholder for correct code for this message. +import datetime + +time_now_utc = datetime.datetime.now(tz=datetime.UTC).time() + +if time_now_utc > datetime.time(6, 0): + print("Daytime!") + +if time_now_utc < datetime.time(6, 0): + print("Nighttime!") diff --git a/doc/data/messages/b/boolean-datetime/pylintrc b/doc/data/messages/b/boolean-datetime/pylintrc new file mode 100644 index 000000000..8429adcfd --- /dev/null +++ b/doc/data/messages/b/boolean-datetime/pylintrc @@ -0,0 +1,2 @@ +[main] +py-version=3.4 diff --git a/doc/data/messages/b/boolean-datetime/related.rst b/doc/data/messages/b/boolean-datetime/related.rst new file mode 100644 index 000000000..584131356 --- /dev/null +++ b/doc/data/messages/b/boolean-datetime/related.rst @@ -0,0 +1 @@ +- `Python bug tracker <https://bugs.python.org/issue13936>`_ |