Open andrej-mitrovic-sociomantic opened 7 years ago
Since this is a C repo, I highly recommend we take advantage of existing tools like uncrustify. There's also a GUI Frontend which can be used to generate a configuration for the indenter with a real-time preview. I've used it before and it's very capable.
Made a dev branch for testing out code formatting with uncrustify. Any input on the formatting style is appreciated :) https://github.com/andreas-bok-sociomantic/libdrizzle-redux/tree/uncrustify, 7b05efd7668e26203c70c26c026b2595d5cb323b for formatting applied to
@leandro-lucarella-sociomantic wondering if this is a not too insane way to add git pre hooks f2d97810c9fe2434c1bb98073587eb36112532af
I usually prefer not to include magic scripts to install things like git hooks. Instead I prefer to rely on documentation. I think you just add a check in the CI to make sure PRs complies to the style using uncrustify. Then is the developer's responsibility to fix it, and you can point to the docs to include uncrustify as a hook.
Oki, i will look into adding a hook in Travis. So do you suggest not including the uncrustify formatting config file at all? Or just the install wrapper script which shouldn't be included?
Created a development branch here, https://github.com/bokchan/libdrizzle-redux/tree/uncrustify
The 2-space indentation is awful to look at, and makes it hard to understand the code flow. Since we own the repo now, it would be a good idea to adapt it to our style guide.