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

Fix typedef NS_CLOSED_ENUM getting an extra space #4307

Merged
merged 5 commits into from
Jun 4, 2024

Conversation

PoeticPete
Copy link
Contributor

This commit is stacked on top of #4305 (so review #4305 before this). PRs from forked repos cannot be stacked, so this PR looks like it contains all of the changes in #4305. If possible, I'd love write access to uncrustify to make this neater in the future!

Fixes #4306

The following gets incorrectly formatted on current master d8c58ec:

#import <Foundation/Foundation.h>

typedef NS_CLOSED_ENUM(NSUInteger, FOO) {
    FOOA,
    FOOB
};

typedef NS_CLOSED_ENUM(NSUInteger, BAR) {
    BARA,
    BARB
};

Into (note the extra space after NS_CLOSED_ENUM):

#import <Foundation/Foundation.h>

typedef NS_CLOSED_ENUM (NSUInteger, FOO) {
    FOOA,
    FOOB
};

typedef NS_CLOSED_ENUM(NSUInteger, BAR) {
    BARA,
    BARB
};

Reproduces on an empty cfg file

Copy link
Collaborator

@gmaurel gmaurel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fine to have somebody for the mm-files

@PoeticPete
Copy link
Contributor Author

Hi @gmaurel! Are you saying it's fine to add a space after the macro?

If there wasn't a space there before, I don't think we should be adding one. Especially if the following declaration doesn't add a space.

Let me know if I'm misunderstanding :)

@gmaurel gmaurel merged commit 8da0fc4 into uncrustify:master Jun 4, 2024
3 checks passed
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.

typedef gets an extra space added
2 participants