You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Comment is not aligned with trailing comment on previous line any more #1134
Release 0.64 introduces a behaviour that reformatted comments in files that I had already uncrustified. Comments are not aligned with previous trailing comments that follow a preprocessor directive. Comments that were previously aligned, like this:
I bisected this down to commit 0092f3d, and the commit message says it is a rule-3 fix. But I can't see where this is a fix. It should be taken back. Or is there an option to get the familiar alignment back? Please advise.
The "rule-3" of comment comment alignment was dealing with comments relatively close to each other (within a 3 column distance). The change you mention was made to defend against another unwanted behavior (in the test) and unfortunately it was not guarded by another option for you to easily deactivate it.
That fix is regressing your case (unknown to present) and we should find a proper way to fix it.
some ideas:
add a configurable threshold (now hard-coded at 3)
have another rule to disable the "rule-3" entirely
have another rule to disable "rule-3" in the case of a preproc (maybe how the initial change should've been implemented)
Thanks for the quick reply!
Personally, I am happy with a hard-coded three-column threshold and have no need to disable the "rule-3" at all. But I don't know what the other unwanted behaviour in the test was, so I can't make a qualified suggestion.
Oh, that's interesting! I couldn't have thought of that, I didn't use Doxygen so far. I think your idea number two is most straigtforward. But maybe some Doxygen users would still want to use rule-3 after a preproc (if not near member group marker). So, I'd like to throw in:
have another rule to disable rule-3 for Doxygen markers "//@}" and "//@{"
That could work as well, but I would also fix it by making Doxygen markers to have 3 comment slashes instead of 2 which will cross the 3 column boundary of rule-3. Could be an option.
I went through the source code to find a function that would help to detect the Doxygen markers, but it's the first time I'm looking at it and will take me more time. I could give it another try next week.
I just downloaded the 0.63 binary from sourceforge again and checked with config file linux.cfg. I definitely don't have the problem there, the alignment is kept in 0.63.
Activity
mihaipopescu commentedon May 2, 2017
The "rule-3" of comment comment alignment was dealing with comments relatively close to each other (within a 3 column distance). The change you mention was made to defend against another unwanted behavior (in the test) and unfortunately it was not guarded by another option for you to easily deactivate it.
That fix is regressing your case (unknown to present) and we should find a proper way to fix it.
some ideas:
Manuel-MM commentedon May 2, 2017
Thanks for the quick reply!
Personally, I am happy with a hard-coded three-column threshold and have no need to disable the "rule-3" at all. But I don't know what the other unwanted behaviour in the test was, so I can't make a qualified suggestion.
mihaipopescu commentedon May 3, 2017
The unwanted behavior was that it added an unwanted extra alignment with Doxygen member groups end marker when it was proceeded by a preproc:
class MyClass : public BaseClass { //@{ BaseClass interface #if VERY_LONG_AND_COMPLICATED_DEFINE void foo(); #endif // VERY_LONG_AND_COMPLICATED_DEFINE - //@} + //@} };Manuel-MM commentedon May 3, 2017
Oh, that's interesting! I couldn't have thought of that, I didn't use Doxygen so far. I think your idea number two is most straigtforward. But maybe some Doxygen users would still want to use rule-3 after a preproc (if not near member group marker). So, I'd like to throw in:
mihaipopescu commentedon May 4, 2017
That could work as well, but I would also fix it by making Doxygen markers to have 3 comment slashes instead of 2 which will cross the 3 column boundary of rule-3. Could be an option.
Manuel-MM commentedon May 4, 2017
I went through the source code to find a function that would help to detect the Doxygen markers, but it's the first time I'm looking at it and will take me more time. I could give it another try next week.
guy-maurel commentedon Jun 2, 2017
which are the Doxygen markers?
guy-maurel commentedon Jun 4, 2017
No!
Version 0.63 has the same.
Please push your configuration, it might be the problem.
Manuel-MM commentedon Jun 4, 2017
I just downloaded the 0.63 binary from sourceforge again and checked with config file linux.cfg. I definitely don't have the problem there, the alignment is kept in 0.63.
guy-maurel commentedon Jun 10, 2017
I am working on it.
a bugfix for uncrustify#1134
guy-maurel commentedon Jun 13, 2017
A proposal for a bugfix is #1205
gmaurel commentedon Jun 14, 2017
The bug is fixed
Merge pull request #1205 from guy-maurel/TrailingComment