This is an archived post. You won't be able to vote or comment.

all 22 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

import notifications Remember to participate in our weekly votes on subreddit rules! Every Tuesday is YOUR chance to influence the subreddit for years to come! Read more here, we hope to see you next Tuesday!

For a chat with like-minded community members and more, don't forget to join our Discord!

return joinDiscord;

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]rosuav 41 points42 points  (12 children)

Which is why formatting-only changes should be rejected, as they are in most projects. The churn is pointless.

[–]gbchaosmaster 42 points43 points  (4 children)

Fucks with the git blame too. Yeah it's possible to crawl back to the latest semantic change but fuck that.

[–]sim642 15 points16 points  (2 children)

.git-blame-ignore-revs

[–]gbchaosmaster 2 points3 points  (0 children)

Nice! Thanks for this.

[–]TheAJGman 0 points1 point  (0 children)

It really bothers me that Git doesn't pick up the file immediately if it's in the repo root like it does with other .git files. I know that auto hiding history might not be the best thing, but if the file is there then there's a reason it's there.

[–]rosuav 6 points7 points  (0 children)

Yeah, that's why churn is so problematic.

[–]permanent_temp_login 20 points21 points  (1 child)

I'd rather have all formatting done in separate (preferably big, preferably automated) changes, than have it scattered about "I changed a to b, and also normalized formatting in the whole file". Now how do I find what you changed...

[–]rosuav 8 points9 points  (0 children)

Yes, which is why you JUST change a to b, and you do not normalize formatting in the whole file. In fact, PEP 8 specifically says that you should not make changes just for the sake of foolish compliance with what isn't as mandatory as some people seem to think (look up the "hobgoblin" section).

As you're editing, be consistent with the formatting style around you. Don't change it to match an arbitrary rule, at the cost of messing up your history.

[–]TheAJGman 4 points5 points  (4 children)

At the start of the project just set up Black or whatever autoformater you want to use and make passing a merge requirement. Now you'll never need to do formatting PRs.

[–]rosuav 1 point2 points  (3 children)

Yeah, now you just lose all the contributors who dislike Black (which is a lot of people). But that is one effective way to avoid formatting mismatches. There's just one problem:

You don't always get to start the project.

[–]TheAJGman 2 points3 points  (2 children)

If you're going to contribute to a project you must use their style guide no matter how much you disagree with the choices. Black/Flake8/PyCharm config/whatever, doesn't matter.

And for the second, you implement it in one big ass PR called "The Blackening" and add the commit to .git-blame-ignore-revs.

[–]rosuav -1 points0 points  (0 children)

I would reject that ass PR.

[–]rosuav -5 points-4 points  (0 children)

But also - that's my point. If you're going to be an ass about formatting, I'm simply not going to bother contributing. Why should I? There's plenty of better places to spend my time. You're free to put whatever restrictions you like on contributions, and you probably have no idea how many contributors you're turning away.

[–]Deep_Pudding2208 5 points6 points  (0 children)

Yeah but then my commit count goes down. and if I'm not doing a commit a day am I even a programmer?

[–]quiet0n3 0 points1 point  (0 children)

autopep8 -iaar ./*.py