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

Macro indenting again #4712

Closed
adsharma opened this issue Feb 21, 2021 · 2 comments
Closed

Macro indenting again #4712

adsharma opened this issue Feb 21, 2021 · 2 comments
Assignees

Comments

@adsharma
Copy link

Context:
https://github.com/adsharma/py2many is a transpiler which generates weirdly formatted code in different languages and expects the language specific formatter to make it readable, both for humans and for automated tests.

rustfmt works great most of the time, except for this issue. This is essentially the same as #1885, but may be a bit narrower.

Input

use flagset::FlagSet;
use std::os::raw::c_int;

flags! {
    enum Permissions: c_int {
R = 1,
W = 2,
X = 16,
}
}

Output

Expected output

use flagset::flags;
use flagset::FlagSet;
use std::os::raw::c_int;

flags! {
    enum Permissions: c_int {
        R = 1,
        W = 2,
        X = 16,
    }
}
@calebcartwright
Copy link
Member

Thanks for reaching out but going close this. rustfmt support for formatting macro calls is still fairly limited, and in cases where the brace delims are used we don't do any formatting at all. #8 is the general macro-related issue folks may want to subscribe to for updates, but to be fully transparent I don't anticipate we'll be formatting these types of mac calls any time soon

@adsharma
Copy link
Author

No worries. Worked around it in the transpiler.

py2many/py2many@532e782

Thanks for looking into it.

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

3 participants