Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black formatter? #99

Closed
evanpurkhiser opened this issue Oct 29, 2024 · 10 comments
Closed

Black formatter? #99

evanpurkhiser opened this issue Oct 29, 2024 · 10 comments

Comments

@evanpurkhiser
Copy link
Contributor

Would you accept a PR that applies the black formatter?

Note

We're using this library in Sentry as part of our cron monitoring product. I am looking at tackling the DST bugs that exist. I would like to also spend some time cleaning up the library source code to make it easier to contribute to.

@kiorky
Copy link
Owner

kiorky commented Oct 30, 2024

Well, that a long interrogation i have which says not a simple no.

Problem is that is is an very old basecode initiated by a non python programmer (not me :)) starting with py-2.3 and the introduce changes of reformatting is a bit overwhelming not to say frightening related to stability and errors...

@kiorky
Copy link
Owner

kiorky commented Oct 30, 2024

For DST handling, also, there is a bit of spaghetti that needs to be refactored to both:

  • refactor tests that make shortcuts around dst but are wrong per se.
  • remove DST handling hacks for a proper DST handling.

That 's why i didnt had the time yet to tackle this by myself.

See #1 and the related attemps, where the later is not that useful as the idea is just to refactor DST handling properly from scratch.

@kiorky
Copy link
Owner

kiorky commented Oct 30, 2024

Well, that a long interrogation i have which says not a simple no.

Problem is that is is an very old basecode initiated by a non python programmer (not me :)) starting with py-2.3 and the introduce changes of reformatting is a bit overwhelming not to say frightening related to stability and errors...

Maybe i was not clear, i would eagerly see a black formatted croniter basecode, but at the condition to be insured not to have any regression :-) .

@kiorky
Copy link
Owner

kiorky commented Oct 30, 2024

Maybe can we process by a /couple of methods/50-100th code lines/ changes by one PR to facilitate review.

@kiorky kiorky mentioned this issue Oct 30, 2024
@evanpurkhiser
Copy link
Contributor Author

Awesome!

I can make a few individual PRs that apply the black formatter.

are you worried the test cases wouldn’t not catch any regressions that (would quite unlikely) be introduced by black if we formatted it all in one go?

@kiorky
Copy link
Owner

kiorky commented Oct 30, 2024

Awesome!

I can make a few individual PRs that apply the black formatter.

are you worried the test cases wouldn’t not catch any regressions that (would quite unlikely) be introduced by black if we formatted it all in one go?

cron is all about user input, test coverage is already large for this purpose, but yes, bad thing can happen.

@evanpurkhiser
Copy link
Contributor Author

I am thinking for the tests files I might just apply black all out, since these are code that run in CI and is not code that is used in production, we can safely say that as long as tests run, everything will be safe.

@evanpurkhiser
Copy link
Contributor Author

I will also add a Github Action that will apply black and can do one of two things:

  1. Fail the PR and require the author apply black to their PR
  2. Auto-commit a black formatting fix to their PR.

The later might be more annoying if we don't make it easy to setup black for development.

@evanpurkhiser
Copy link
Contributor Author

Let's close this. The codebase is now blacked :)

@kiorky
Copy link
Owner

kiorky commented Oct 31, 2024

i just also added isort in the loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants