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

🎨 Change Formatting 🎨 #454

Open
FT-Labs opened this issue Mar 2, 2023 · 3 comments
Open

🎨 Change Formatting 🎨 #454

FT-Labs opened this issue Mar 2, 2023 · 3 comments

Comments

@FT-Labs
Copy link

FT-Labs commented Mar 2, 2023

Is your feature request related to a problem? Please describe.
Change formatting of C source files

Describe the solution you'd like
I think for this project kernel C syntax would be much better. There are 3 things that could change:

Both for structs and for-if-while (anything other than functions) braces, they should start at the end of first statement. Instead of this:

typedef struct
{

This one should be used:

typedef struct {
...

As for functions braces should start after statement. But for any other loop - statement - definition, it should look like this:

while {
...
}
for ;; {
...
}

Last one is comments. All of the comments should be a multiline comment, and with a * on each of the following lines.

// Instead of comment
/* Comment */
/* This
*  Is
*  Multiline comment
*/

I can handle this formatting if that is okay.
https://www.kernel.org/doc/html/v4.10/process/coding-style.html

@jbampton
Copy link
Member

jbampton commented Mar 2, 2023

We are using Clang Format. Not sure how well it is being used. But it runs with pre-commit

https://github.com/One-Language/One/blob/main/.clang-format

- id: clang-format

@jbampton
Copy link
Member

jbampton commented Mar 2, 2023

refs #172

@FT-Labs
Copy link
Author

FT-Labs commented Mar 2, 2023

Suggested .clang-format
6c7cbe1

@jbampton jbampton self-assigned this May 31, 2023
@jbampton jbampton changed the title Change Formatting 🎨 Change Formatting 🎨 Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants