Skip to content

docs: add Code_style.md#518

Draft
Physic69 wants to merge 5 commits into
luainkernel:masterfrom
Physic69:concat
Draft

docs: add Code_style.md#518
Physic69 wants to merge 5 commits into
luainkernel:masterfrom
Physic69:concat

Conversation

@Physic69
Copy link
Copy Markdown
Contributor

Adds Code_style.md to formalize project-wide C coding standards

Co-authored-by: jperon <cataclop@hotmail.com>
Comment thread Code_style.md Outdated
Comment thread Code_style.md Outdated
Comment on lines +233 to +235
## Line breaks, new lines and file Endings

All source files must end with one empty line. Files should not contain multiple consecutive empty lines.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think about this? I'm thinking on dropping this requirement.. I notice Claude Code, at least, has some trouble on sticking to this rule.. I'm not sure the benefit of having this rule pays off...

@carloslack would be good to have your input on this, as well.. ;-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried putting these rules through Claude Code first? It might help us see which ones it consistently struggles with, and then we can decide whether to drop or relax them...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many times.. it seems to forget about this all the time

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can relax this a bit. git expects a for new line att EOF for proper maintenance, so my suggestion:
All source files must end with a single newline. Avoid using more than one consecutive empty line within source files.
That way it’s simple, and not too strict. WDYT?

Comment thread Code_style.md Outdated
@@ -0,0 +1,235 @@
# Lunatik C Code Style Guide

This guide outlines the code style conventions observed in the `lunatik.h` header file, which should be followed for consistency across the Lunatik project. As a general rule, we tend to stick to [Linux kernel rules](https://www.kernel.org/doc/html/latest/process/coding-style.html).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if it wouldn't be easier to just base our style on something existent, like this one, and just ask Claude to document the differences..

Comment thread Code_style.md
```c
if (condition) {
/* ... */
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another thing that I notice Claude has some difficult is on..

if (...) {
...
}
else

it always get back to this..

if (...) {
...
} else

thinking o dropping this requirement as well..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i assume, dropping this requirement means, sticking to linux kernel style...

@Physic69 Physic69 requested a review from lneto March 31, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants