libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
9.38k stars 1.74k forks source link

Add an automated code style checker #6902

Open ihhub opened 1 year ago

ihhub commented 1 year ago

As every source code project it is very important to maintain quality of the code and be consistent at all times. This project has a lot of code and every developer decides code style by themselves leading to a mix of different styles which is hard to read and maintain. You should consider adding a code style checker, for example clang-format, into your GitHub Actions pipeline to standartize your code style. More importantly if you want to release SDL 3 it is the time to implement such feature.

slouken commented 10 months ago

@1bsyl, @madebr, didn't we have this going at one point?

madebr commented 10 months ago

Since https://github.com/libsdl-org/SDL/commit/fa8fba3812a03bb08a9eeaefc82aa140baa47bbb, we run clang-tidy on ci. SDL has a .clang-format file in the root directory, but clang-format is not executed on ci.

slouken commented 10 months ago

Yeah, I think we want to warn (or fail) on code style mismatch, but not automatically reformat.