flake8-datetimez
flake8-datetimez copied to clipboard
A plugin for flake8 to ban the usage of unsafe naive datetime class.
I'm interested in pytz linting, specifically preventing pytz timezone classes (`BaseTzInfo`) from being used directly as the `tzinfo` argument with `datetime.datetime(tzinfo=)` and with `.replace(tzinfo=)`, since that is [almost always an...
Would it be possible to also lint datetimes from `Faker`? It has a whole provider for datetimes https://faker.readthedocs.io/en/master/providers/faker.providers.date_time.html?highlight=future_datetime For example this usecase: ```python FAKE = Faker() FAKE.future_datetime() ``` Would fail...
I am not sure if this is the right way to do it. but if you want to get a datetime from a timestamp and be aware of the timestamp's...
Calling `.astimezone()` should not result in a flake8 violation since it returns a tz-aware datetime object. However because it is called after creating a naive datetime object it is not...
Fixes #9
If I use an import alias the plugin doesn't detect the unsafe datetime usage ### Example ```python import datetime as dt print(dt.datetime.now()) # This should be flagged as an unsafe...