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

Suggestion: Can we use a formatter (e.g black)? #23

Closed
paketb0te opened this issue Jan 25, 2023 · 5 comments
Closed

Suggestion: Can we use a formatter (e.g black)? #23

paketb0te opened this issue Jan 25, 2023 · 5 comments

Comments

@paketb0te
Copy link
Contributor

IMO a formatter like black improves readability and consistency of the code, maybe that could be something to adopt?

Just an idea, let me know what you think @initialcommit-io

(most editors / IDEs support some sort of "format-on-save" functionality AFAIK, or it could be set up as a pre-commit hook I guess...)

@initialcommit-io
Copy link
Contributor

@paketb0te Yes I am open to this, I use Vim so maybe I could use a pre-commit hook like you suggested. Let me look into the formatter and some other options and I'll get back to you.

@initialcommit-io
Copy link
Contributor

@paketb0te Let's do it. I asked @marksmayo to resubmit a PR for this which I will merge. Then we can use black going forward. Thanks for the suggestion!

Any other special notes on using black that we should be aware of? This will be my first time using it.

@paketb0te
Copy link
Contributor Author

paketb0te commented Jan 27, 2023

@initialcommit-io no, it has good defaults, we can just run it as-is IMO.

Only thing to keep in mind: It will reformat all files, so whoever runs the formatting and then commits back to the repo will be the author of the last change for everything (e.g. if you do a git blame, the person who did the reformatting wil show up (until a new commit made changes of course), instead of the "original" author. Therefore I suggest that YOU run the formatting and commit it, because you wrote 99% of the code...

@initialcommit-io
Copy link
Contributor

Good point. I will do the formatting now with black, and if there is some import cleanup or commas to be added as in the pull request, @marksmayo can clean that up.

@initialcommit-io
Copy link
Contributor

Reformatted and pushed in as a part of v0.1.6

Closing this - all contributors please use black for formatting going forward.

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