sociomantic-tsunami / libdrizzle-redux

The next generation of Libdrizzle with a simplified API and support for more features of the protocol
Other
13 stars 12 forks source link

Run indenter on the codebase? #131

Open andrej-mitrovic-sociomantic opened 7 years ago

andrej-mitrovic-sociomantic commented 7 years ago

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.

andrej-mitrovic-sociomantic commented 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.

andreas-bok-sociomantic commented 7 years ago

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

andreas-bok-sociomantic commented 7 years ago

@leandro-lucarella-sociomantic wondering if this is a not too insane way to add git pre hooks f2d97810c9fe2434c1bb98073587eb36112532af

leandro-lucarella-sociomantic commented 7 years ago

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.

andreas-bok-sociomantic commented 7 years ago

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?

bokchan commented 5 years ago

Created a development branch here, https://github.com/bokchan/libdrizzle-redux/tree/uncrustify