Open Stanzilla opened 6 years ago
I actually wrote this for Py2.7 and haven't tried under Py3, so I imagine it doesnt work. I'd be open to updating it though!
Oh, that would be nice if you could put that in the readme?
I'm stuck here now:
/mnt/c/Users/Benjamin/VCS/Git/KVIrc master ⇡
❯ git clean -f
/mnt/c/Users/Benjamin/VCS/Git/KVIrc master ⇡
❯ python /mnt/c/Users/Benjamin/VCS/Git/fit-clang-format/fit-clang-format.py
=> Testing base styles to see which seems to fit best.
Checking out files: 100% (2323/2323), done.
+ (5335.13, 1071.00, 340.30): {'BasedOnStyle': 'LLVM'}
Traceback (most recent call last):
File "/mnt/c/Users/Benjamin/VCS/Git/fit-clang-format/fit-clang-format.py", line 433, in <module>
], strictly_better=False)
File "/mnt/c/Users/Benjamin/VCS/Git/fit-clang-format/fit-clang-format.py", line 188, in search
with project.apply_temporary_style(style):
File "/mnt/c/Users/Benjamin/VCS/Git/fit-clang-format/git.py", line 176, in apply_temporary_style
raise ValueError("git repo is not clean")
ValueError: git repo is not clean
/mnt/c/Users/Benjamin/VCS/Git/KVIrc master ⇡ 34s
❯
since it generates a new .clang-format, they project can't actually be clean at that moment, can it?
A way to go around it is by ignoring .clang-format for the time being by putting it in .gitignore
. The is_dirty
helper may benefit from having a filter that the other parts of the scripts are using.
Another good thing to have is to have an option to not use git for diffing instead. That calls for copying files (with reflink
preferably), running our own gitignore-like rules, and feeding all that to difflib
.
I'm open to using a different diff util; I trust and like git, so figured that was a good one.
Another option is to modify the scripts to ignore .clang-format files as part of their logic.
any ideas?
next try was running the .py itself: