Skip to content

Add support to nl_after_c_comment - #4755

Open
acassis wants to merge 1 commit into
uncrustify:masterfrom
acassis:add_nl_after_comment
Open

acassis wants to merge 1 commit into
uncrustify:masterfrom
acassis:add_nl_after_comment

Conversation

@acassis

@acassis acassis commented Jul 17, 2026 •

Copy link
Copy Markdown

Hi Uncrustify team,

I think uncrustify is the only lint/formatter able to fix almost 95% of source code to fit the NuttX coding style:
https://nuttx.apache.org/docs/latest/components/tools/uncrustify.html

But it doesn't support to add a new line after a comment line:

/* This is a single line comment */
bool code_need_empty_line_after_comment = true;

shold be converted to:

/* This is a single line comment */

bool code_need_empty_line_after_comment = true;

Comment thread src/options.h Outdated
I think uncrustify is the only lint/formatter able to fix almost 95%
of source code to fit the NuttX coding style. But there is not support
to add new line after a comment line:

/* This is a single line comment */
bool code_need_empty_line_after_comment = true;

shold be converted to:

/* This is a single line comment */

bool code_need_empty_line_after_comment = true;

Signed-off-by: Alan C. Assis <acassis@gmail.com>
@acassis
acassis force-pushed the add_nl_after_comment branch from 114bb62 to 1df81ac Compare July 17, 2026 19:09
@acassis

acassis commented Jul 26, 2026

Copy link
Copy Markdown
Author

ping @gmaurel

@micheleCTDEAdmin

Copy link
Copy Markdown
Collaborator

@acassis please fix the failing tests. Also note that when you add a new option, there are a number of files that need to be updated. You can look where other options are used and do the same for the new option. Alternatively you can use the optiondocs of the release_tool.py script to do that.

@gmaurel

gmaurel commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

@acassis
What about theproposal?

@acassis

acassis commented Aug 9, 2026

Copy link
Copy Markdown
Author

@acassis What about theproposal?

Hi @gmaurel basically this: https://nuttx.apache.org/docs/latest/contributing/coding_style.html#comments

We need a rule to add a NL after a single comment. For multi-line comments there is already a rule to force a NL, but not for single line.

@micheleCTDEAdmin

Copy link
Copy Markdown
Collaborator

@acassis can you look at the failing tests?

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

Successfully merging this pull request may close these issues.

3 participants