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

[Feature]: Uncrustify settings enforcing no black line after a conditional #231

Closed
rogurr opened this issue Jan 24, 2023 · 4 comments
Closed
Assignees
Labels
state:needs-maintainer-feedback Needs more information from a maintainer to determine next steps state:needs-triage Needs to triaged to determine next steps state:stale Has not been updated in a long time type:feature-request A new feature proposal urgency:low Little to no impact

Comments

@rogurr
Copy link

rogurr commented Jan 24, 2023

Feature Overview

A lot of times the code line following a conditional is directly tied to the outcome of the check and it makes sense not to have blank lines inserted.

But if the next line is starting an unrelated task that has it's own comments, not having a blank line to help highlight the comments can make readability harder.

For instance, this code snippet is the original prior to running uncrustify:

 1:  // On error, skip writing the data
 2:  if (!EFI_ERROR (Status)) {
 3:
 4:    // Write depex as a series of hex bytes
 5:    for (x = 0; x < DepexSize; x++) {
 6:      MessageAscii (MsgBuffer, "%02X", Depex[x]);
 7:    }
 8:
 9:    // Free memory provided by the ReadSection call
10:    FreePool (Depex);
11:  }

Running uncrustify removes line 3, pushing the comment directly up under the IF statement making the comment hard to distinguish:

 1:  // On error, skip writing the data
 2:  if (!EFI_ERROR (Status)) {
 4:    // Write depex as a series of hex bytes
 5:    for (x = 0; x < DepexSize; x++) {
 6:      MessageAscii (MsgBuffer, "%02X", Depex[x]);
 7:    }
 8:
 9:    // Free memory provided by the ReadSection call
10:    FreePool (Depex);
11:  }

Solution Overview

Can we have the uncrustify.cfg file updated to remove the enforcement of no blank line after a conditional?

Alternatives Considered

No response

Urgency

Low

Are you going to implement the feature request?

Someone else needs to implement the feature

Do you need maintainer feedback?

Maintainer feedback requested

Anything else?

No response

@rogurr rogurr added state:needs-triage Needs to triaged to determine next steps type:feature-request A new feature proposal labels Jan 24, 2023
@github-actions github-actions bot added state:needs-maintainer-feedback Needs more information from a maintainer to determine next steps urgency:low Little to no impact state:needs-owner Needs an issue owner to be assigned labels Jan 24, 2023
@makubacki makubacki self-assigned this Jan 24, 2023
@apop5 apop5 removed the state:needs-owner Needs an issue owner to be assigned label Jan 31, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in 45 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the state:stale Has not been updated in a long time label Mar 17, 2023
@rogurr
Copy link
Author

rogurr commented Mar 18, 2023

Adding a comment to keep it from being auto-closed.

@github-actions github-actions bot removed the state:stale Has not been updated in a long time label Mar 18, 2023
@github-actions
Copy link

github-actions bot commented May 3, 2023

This issue has been automatically marked as stale because it has not had activity in 45 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the state:stale Has not been updated in a long time label May 3, 2023
@github-actions
Copy link

This issue has been automatically been closed because it did not have any activity in 45 days and no follow up within 7 days after being marked stale. Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:needs-maintainer-feedback Needs more information from a maintainer to determine next steps state:needs-triage Needs to triaged to determine next steps state:stale Has not been updated in a long time type:feature-request A new feature proposal urgency:low Little to no impact
Projects
None yet
Development

No branches or pull requests

3 participants