-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
tools/nxstyle.c: FALSE alarms on right hand aligned comments. #120
Comments
I think that the problem is an ordering one in nxstyle.c:
I think that the error occurs because the test of prevbrhcmt at line 718 occurs BEFORE it is set the the current line at lines 963 or 1395 |
…column position of right of code comments
@patacongo I had again a little fun with nxstyle this afternoon. |
I never look at code outside of the respository. Not interested. PS: Everyone on the Apache time as instant merging power and use that power frequently. |
The tests that should be performed are:
Then run that before the change like:
Then rebuild with the modified nxstyle.c and:
Then compare before.txt with after .txt. They should be identical or, if there are false positives/negatives in before.txt, then after.txt might have fixed those. |
… position of right of code comments
…column position of right of code comments
When ran against any file that has comments to the right of definitions, a false alarm can occur. Such right-hand comments should be vertically aligned, but have not specific alignment requirement with regard to the start of the line or any indentation.
In many casese, there are comments on a separate line are correctly aligned with the other right hand comments. This is necessary for the visually alignment, but results in a false alarm error from nxstyle. Consider the following from include/nuttx/can/can.h:
Running nxstyle against that file generates this false alarm:
Analysis: Notice that there is no error about the missing blank line BEFORE the comment at 583. That is because there is information that the preceding line is right-hand aligned.
The problem is that the state information is not propagated at line 583. Could the solution be as simple as just make sure that brhcomment is set true again when the conditioni of line 583 is encountered?
The text was updated successfully, but these errors were encountered: