Skip to content

meson: enable the clang-format target, and use it in the CI

Eric Engestrom requested to merge eric/mesa:clang-format into main

.clang-format needs to exist in the root of the project for the target to be generated, but since we don't have a global config it's a dummy, empty file.

.clang-format-include lists the files (files! not folders) that are to be formatted.

See https://mesonbuild.com/Code-formatting.html


The main reason to do this is that meson supports listing files in .clang-format-ignore to prevent vendored code from being formatted/breaking the CI before it's not formatted.

As a nice bonus, formatting everything becomes a simple ninja -C build/ clang-format for those who don't have an editor that does it automatically.

Merge request reports