karlstav / cava

Cross-platform Audio Visualizer
MIT License
4.33k stars 233 forks source link

Adopt a Source Style #210

Closed winny- closed 4 years ago

winny- commented 6 years ago

It appears some of the source files have mixed tabs & spaces, and inconsistent style. What C style does this project use?

ginkage commented 6 years ago

According to CONTRIBUTING.md, it's supposed to be "tab for indents; curly braces on same line as if, while, for statements". I agree that this project could use some clang-format treatment.

karlstav commented 6 years ago

I used to use something called astyle to style it automatically, but then I was advised not to use automatic styling and just be more consistent when writing the code.

Since then I guess it has slipped out a bit.

This is on the todo-list, since my time is limited at the moment please feel free to contribute!

antiprism commented 6 years ago

I have been using clang-format for a project, and I find it makes life very easy. I don't enforce the style for contributions, but just apply it to all the code from time to time. It is possible to exclude blocks, e.g. preformatted help text, from being reformatted.

https://clang.llvm.org/docs/ClangFormat.html

quantum5 commented 4 years ago

clang-format has been adopted in #292.