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

align_assign_decl_func=0 is not working as expected #4286

Open
JEAYNE opened this issue Apr 22, 2024 · 0 comments
Open

align_assign_decl_func=0 is not working as expected #4286

JEAYNE opened this issue Apr 22, 2024 · 0 comments

Comments

@JEAYNE
Copy link
Contributor

JEAYNE commented Apr 22, 2024

Uncrustify-0.78.1_f downloaded from github, running on Windows 11.

Remainder: Explanation for option 'align_assign_decl_func'

How to apply align_assign_span to function declaration "assignments",
i.e. 'virtual void foo() = 0' or '~foo() = {default|delete}'.
0: Align with other assignments (default)
1: Align with each other, ignoring regular assignments
2: Don't align

For this input file

struct foo {
    int id = 0;
    virtual void f() = 0;
    int debugLevel = 2;
    ~foo() = default;
    int done = 3;
};

These two commands:
uncrustify -c /dev/null --set align_assign_decl_func=0 --set align_assign_span=3 -f input.cpp
uncrustify -c /dev/null --set align_assign_decl_func=1 --set align_assign_span=3 -f input.cpp

Give the same output:

struct foo {
    int id         = 1;
    virtual void f() = 0;
    int debugLevel = 2;
    ~foo()           = default;
    int done       = 3;
};

The output above is ok when align_assign_decl_func=1

But for align_assign_decl_func=0 I'm expecting the output below:

struct foo {
    int id           = 0;
    virtual void f() = 0;
    int debugLevel   = 2;
    ~foo()           = default;
    int done         = 3;
};

The attached file contains the input file, the config files, the output files and the debug files for align_assign_decl_func=0 and align_assign_decl_func=1

align_assign_decl_func.tar.gz

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