Skip to content

r300: reformat the compiler using clang-format

Pavel Ondračka requested to merge ondracka/mesa:r300_compiler_clang_format into main

I wanted to get rid of the tabs in the r300 compiler for quite some time. Hopefully this overweights the disadvantage of polluting the history and more complicated git-blame. Specifically for the compiler git-blame most of the times shows the commit which moved the compiler from the classic to the gallium driver, so this will add just one more step when trying to trace origin of something. I used the top-level rules without any customizations. I don't have any big issues with the default style and I'm also quite happy with the 100 character limit (not that I tried too hard to stick to 80 previously).

@gawin what are your style preferences?

I did not touch the driver yet (but I'm open to discussion), there are no tabs AFAICS and the git history there is quite clean, so the benefits seem not that big. It means we will not be consistent between the driver and the compiler but we never were. Driver uses 4 spaces so in theory we could convert the compiler to 4 spaces and be consistent with the driver, but this way we are more consistent with rest of the tree, so yeah...

If I could I would like to reflow comments to the new 100 character limit. However I could not figure this out (it seems it works only the other way around, i.e., shortening).

@okias by adding the .clang-format files will the ci already automatically start enforcing it or do I need to do something extra?

Edited by Pavel Ondračka

Merge request reports