daft-engineers / vocoder

Open source vocoder designed for the Raspberry Pi.
https://daft-engineers.github.io/vocoder/
Mozilla Public License 2.0
11 stars 0 forks source link

Linting standard #27

Closed MHCooke closed 1 year ago

MHCooke commented 1 year ago

As a developer, I want to keep all the code looking consistent so that I can read other developers code more easily.

MHCooke commented 1 year ago

Clang Format supports a selection styles by default, they have been grouped by brace placement:

In-line:

New line:

Functions/Classes/Structs new line, rest inline:

Purely out of personal preference, I would like one from the in-line group. All these coding styles implement a max line length of 80 characters, which I propose increasing to 100 or 120.

The in-line formats all inherit from the google code style, with their own variations. Google style has one main oddity, they put a trailing underscore after class attributes/data members (but not in structs)

See this handy repo for the difference between each major style: https://github.com/motine/cppstylelineup

bear-in-the-air commented 1 year ago

My preference would also be one from the in-line group as I like the compactness. I like the LLVM style the most, it has no major sins, and I like it's enum choice best, but I'm open to other options.

MHCooke commented 1 year ago

LLVM is decent but I have two issues with it, which we might be able to fix:

MarkAHarley commented 1 year ago

GNU is my personal favourite but if we're going for one in the in-line group I would go for LLVM. Also I don't mind omitting braces for single line control flow, and those Field initialisations I don't hate but would probably just keep on the first line.

Jambls commented 1 year ago

I'm happy with LLVM.