Closed szmktk closed 3 months ago
@szmktk What do you think about configuring git to ignore this reformatting commit when running git blame
? Here's example from Black's docs (solution is tool agnostic, so it doesn't matter that we're not using black) https://black.readthedocs.io/en/stable/guides/introducing_black_to_your_project.html#avoiding-ruining-git-blame
@MateuszBelczowski Sure thing! I didn't even know that such a setting even exists! Thanks for sharing that, I'll re-do the commit and push :ok_hand:
@MateuszBelczowski This --ignore-rev
option seems to only have effect when configured on developers' local machine.
One needs to pass commit sha1 either directly on command line or in a specific file in order for this to work.
I cannot modify your local git config, all I can do is include .git-blame-ignore-revs
file with the commit id that is the subject of this PR. The question is how badly you need this 😁 ?
@MateuszBelczowski This
--ignore-rev
option seems to only have effect when configured on developers' local machine.One needs to pass commit sha1 either directly on command line or in a specific file in order for this to work.
I cannot modify your local git config, all I can do is include
.git-blame-ignore-revs
file with the commit id that is the subject of this PR. The question is how badly you need this 😁 ?
I was thinking about creating this .git-blame-ignore-revs
file and putting hash of the reformatting commit there. But I actually can live without it, if we don't want to do this 😅
We do, at least I'm curious to try it - so I've added the file.
It indeed seems to work if you invoke git blame like this:
git blame manage.py --ignore-revs-file .git-blame-ignore-revs
Then you'll see git blame unaffected by commit 230a2a9
.
I don't know yet how to configure an editor to respect this setting, but we can figure it out together in-person 😉
Introducing ruff. This PR is quite big but the contents do not modify the code functionally at all, just formats it in unified manner.
Ruff is invoked as a pre-commit hook.
pre-commit
install instructionswill beare now added to README.mdsoon:slightly_smiling_face: but for now you need to run this command once in order to useruff
withpre-commit
:session_011
is merged I will change the target of this PR todevelop
.