jhuber6 wrote:

> > Just do what the formatter says, not every file is 100% clang-formatted so 
> > there's bits of old code that haven't been properly cleaned yet. This was 
> > the same line that I thought looked wrong so it should probably be fixed. 
> > Using `git clang-format HEAD~1` only formats what you've changed, so you 
> > don't need to worry about spurious edits.
> 
> Isn't the standard to follow the existing style, not re-format small sections 
> of code during a commit to a different style?
> 
> [Always follow the golden rule:
> 
> If you are extending, enhancing, or bug fixing already implemented code, use 
> the style that is already being used so that the source is uniform and easy 
> to follow.](https://llvm.org/docs/CodingStandards.html)

Yes, but this doesn't really apply since you changed the function signature so 
it needs to be reformatted. That rule primarily applies to sections that have 
been manually formatted but don't exactly match the `clang-format` rules. 
Another reason we don't do bulk `clang-format` everywhere is because it 
confuses `git blame`. However, in this case there's really no reason not to.

https://github.com/llvm/llvm-project/pull/69371
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to