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

Line length on a line comment character leads to divergent formatting results #4222

Open
mathstuf opened this issue Feb 2, 2024 · 0 comments

Comments

@mathstuf
Copy link

mathstuf commented Feb 2, 2024

Configuration: https://gist.github.com/mathstuf/d28e774a3f7b3e7f058db1a65b1cf9f3

Source:

int
foo()
{
  a_long_function_name( some_arguments_that_take_up_space, another_argumen ); // MAYBE
}

With the given configuration, every time the file is formatted, a new empty comment is added. The line length lands on the second / in the comment token.

% uncrustify -c .uncrustify.cfg --replace comment-line-break.cxx
do_source_file: Parsing: comment-line-break.cxx as language CPP
% cat comment-line-break.cxx
int
foo()
{
  a_long_function_name( some_arguments_that_take_up_space, another_argumen ); //
                                                                              // MAYBE
}
% uncrustify -c .uncrustify.cfg --replace comment-line-break.cxx
do_source_file: Parsing: comment-line-break.cxx as language CPP
% cat comment-line-break.cxx
int
foo()
{
  a_long_function_name( some_arguments_that_take_up_space, another_argumen ); //
                                                                              //
                                                                              // MAYBE
}
% uncrustify -v
Uncrustify-0.78.1
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

2 participants