Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a policy on whitespace use and enforce it #11

Open
LeSpocky opened this issue Nov 26, 2017 · 6 comments
Open

Set a policy on whitespace use and enforce it #11

LeSpocky opened this issue Nov 26, 2017 · 6 comments

Comments

@LeSpocky
Copy link
Contributor

Currently indentation is done by mixed tabs and spaces and different indentation levels (2 spaces, 4 spaces, …). Choose one policy and stick to it, maybe with editor modelines.

@LeSpocky LeSpocky mentioned this issue Dec 1, 2017
@penguineer
Copy link
Owner

How about defining a clang-format file and have a hook check all commits against the format?
(With an additional make target to apply the format to all changes.)

@LeSpocky
Copy link
Contributor Author

LeSpocky commented Dec 2, 2017

Never heard about clang format files, but a hook checking would certainly lead to more consistent results.

@penguineer
Copy link
Owner

About clang-format: https://clang.llvm.org/docs/ClangFormat.html
Also available in Debian: https://packages.debian.org/stretch/clang-format-3.8

The level of checking/corrections can be specified in the formats file. We use this at work to check consistency with our Coding Guidelines.

@LeSpocky
Copy link
Contributor Author

LeSpocky commented Dec 3, 2017

So first step would be to specify this formats file or someone picks an existing one, we can agree on. This would already allow to add new code in the desired format, even without a repository hook.

@penguineer
Copy link
Owner

Just found this: http://cf.monofraps.net/

There are lot of C++ styles out there, but I have not found an explicit C style yet.

We need to consent on a C-based coding style anyways, as there are already different styles in the available code.

@penguineer
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants