[GH-ISSUE #23] Suggestion: Can we use a formatter (e.g black)? #18

Closed
opened 2026-03-02 16:47:09 +03:00 by kerem · 5 comments
Owner

Originally created by @paketb0te on GitHub (Jan 25, 2023).
Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/23

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...)

Originally created by @paketb0te on GitHub (Jan 25, 2023). Original GitHub issue: https://github.com/initialcommit-com/git-sim/issues/23 IMO a formatter like [`black`](https://github.com/psf/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...)
kerem closed this issue 2026-03-02 16:47:09 +03:00
Author
Owner

@initialcommit-io commented on GitHub (Jan 26, 2023):

@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.

<!-- gh-comment-id:1405420194 --> @initialcommit-io commented on GitHub (Jan 26, 2023): @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.
Author
Owner

@initialcommit-io commented on GitHub (Jan 27, 2023):

@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.

<!-- gh-comment-id:1406108712 --> @initialcommit-io commented on GitHub (Jan 27, 2023): @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.
Author
Owner

@paketb0te commented on GitHub (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...

<!-- gh-comment-id:1406127194 --> @paketb0te commented on GitHub (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...
Author
Owner

@initialcommit-io commented on GitHub (Jan 27, 2023):

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.

<!-- gh-comment-id:1406204978 --> @initialcommit-io commented on GitHub (Jan 27, 2023): 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.
Author
Owner

@initialcommit-io commented on GitHub (Jan 27, 2023):

Reformatted and pushed in as a part of v0.1.6

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

<!-- gh-comment-id:1406243346 --> @initialcommit-io commented on GitHub (Jan 27, 2023): Reformatted and pushed in as a part of v0.1.6 Closing this - all contributors please use black for formatting going forward.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-sim#18
No description provided.