A plugin for flake8 to ban the usage of unsafe naive datetime class.
Project description
# flake8-datetimez
A plugin for flake8 to ban the usage of unsafe naive datetime class.
## List of warnings
DTZ001 : The use of datetime.datetime() without tzinfo argument is not allowed.
DTZ002 : The use of datetime.datetime.today() is not allowed. Use datetime.datetime.now(tz=) instead.
DTZ003 : The use of datetime.datetime.utcnow() is not allowed. Use datetime.datetime.now(tz=) instead.
DTZ004 : The use of datetime.datetime.utcfromtimestamp() is not allowed. Use datetime.datetime.fromtimestamp(, tz=) instead.
DTZ005 : The use of datetime.datetime.now() without tz argument is not allowed.
DTZ006 : The use of datetime.datetime.fromtimestamp() without tz argument is not allowed.
DTZ007 : The use of datetime.datetime.strptime() must be followed by .replace(tzinfo=).
DTZ011 : The use of datetime.date.today() is not allowed. Use datetime.datetime.now(tz=).date() instead.
DTZ012 : The use of datetime.date.fromtimestamp() is not allowed. Use datetime.datetime.fromtimestamp(, tz=).date() instead.
## Install
Install with pip
` $ pip install flake8-datetimez `
## Requirements - Python 3.6 or above - flake8 3.0.0 or above
## License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for flake8-datetimez-19.4.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b5003ea03582bb1cbe0858a63e05b421a6cbbdc849a26ce37796ea1df7dcd69 |
|
MD5 | 8c98f5df6e8add0dd8f4572f31366b53 |
|
BLAKE2b-256 | 15cd96a078119151740a072e0f3a851159da33a78345957721fabc20793d663a |