Skip to content

template: Add flake8-datetimez#506

Merged
llucax merged 3 commits intofrequenz-floss:v0.x.xfrom
llucax:datetimez
Feb 17, 2026
Merged

template: Add flake8-datetimez#506
llucax merged 3 commits intofrequenz-floss:v0.x.xfrom
llucax:datetimez

Conversation

@llucax
Copy link
Contributor

@llucax llucax commented Feb 11, 2026

The flake8-datetimez plugin is a Flake8 extension that makes sure no functions that create naive datetime objects (without a timezone) are not used.

Fixes #140.

@llucax llucax requested a review from a team as a code owner February 11, 2026 12:51
@llucax llucax requested review from ela-kotulska-frequenz and removed request for a team February 11, 2026 12:51
@github-actions github-actions bot added the part:template Affects the cookiecutter template files label Feb 11, 2026
@llucax llucax linked an issue Feb 11, 2026 that may be closed by this pull request
@llucax llucax added the part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) label Feb 11, 2026
@llucax llucax self-assigned this Feb 11, 2026
@llucax
Copy link
Contributor Author

llucax commented Feb 11, 2026

@cwasicki one reason I didn't move forward with this before is because I never had time to investigate if it catches all cases properly, did you tried it in any projects to report if it was working well or not? We also had an attempt to do our own before we knew this one existed, but we based in on pylint, which is slower but can perform more advanced checks.

I guess having something, even if it is not perfect, is better than nothing, but if you have been bumping into issues with accidentally creating naive datetimes lately, it might be useful to make some test to see if this plugin helps, if you didn't before.

@cwasicki
Copy link
Contributor

Amazing, thanks a lot for looking into this! I only did a quick test and it discovered a couple of cases. @phillip-wenig-frequenz has actually implemented it in one of our repos and might have some input about potential pitfalls. Will ping you on the PR.

Marenz
Marenz previously approved these changes Feb 16, 2026
Copy link
Contributor

@Marenz Marenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but needs rebasing

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Automatically adds the flake8-datetimez dependency to migrated projects.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax
Copy link
Contributor Author

llucax commented Feb 16, 2026

Rebased, needs a new approval.

@llucax llucax enabled auto-merge February 16, 2026 12:41
@llucax llucax requested a review from Marenz February 16, 2026 12:41
@llucax llucax added this pull request to the merge queue Feb 17, 2026
Merged via the queue into frequenz-floss:v0.x.x with commit 0436390 Feb 17, 2026
6 checks passed
@llucax llucax deleted the datetimez branch February 17, 2026 10:13
@llucax llucax modified the milestone: v0.15.0 Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:template Affects the cookiecutter template files part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add flake8-datetimez plugin

3 participants