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

skip_macro_invocations: Cannot configure from rustfmt.toml #5816

Closed
DCNick3 opened this issue Jul 5, 2023 · 2 comments · Fixed by #5817
Closed

skip_macro_invocations: Cannot configure from rustfmt.toml #5816

DCNick3 opened this issue Jul 5, 2023 · 2 comments · Fixed by #5817

Comments

@DCNick3
Copy link

DCNick3 commented Jul 5, 2023

skip_macro_invocations option doesn't parse as documented.

Writing skip_macro_invocations=["*", "println"] in rustfmt.toml leads to this error:

Error: Decoding config file failed:
unknown variant `*`, expected `Name` or `All`
in `skip_macro_invocations`

Please check your config file.

It seems that parsing rules are not what is actually designed (* or some name), but more like tagged serde enum. These config files work:

[[skip_macro_invocations]]
Name="aboba"
skip_macro_invocations = ["All"]
@DCNick3
Copy link
Author

DCNick3 commented Jul 5, 2023

It also seems that there is some difference in behaviour between 1.5.2-stable and 1.6.0-nightly (0ab38e9 2023-07-03) (the posted example configs only work on nightly)

DCNick3 added a commit to DCNick3/iroha that referenced this issue Jul 5, 2023
…ks, I hate it)

`rustfmt` wants `socket_addr!(127.0.0.1: port);` to be formatted as `socket_addr!(127.0.0 .1: port);`...

There is an option to exclude a certain macro invocations from being formatted, but

1) the config option parsing seems broken rust-lang/rustfmt#5816
2) the toolchain used in CI doesn't support it

I guess we would have to live with this ugly formatting for some time...

Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
@DCNick3
Copy link
Author

DCNick3 commented Jul 6, 2023

Thanks for a swift fix!

DCNick3 added a commit to DCNick3/iroha that referenced this issue Jul 6, 2023
…ks, I hate it)

`rustfmt` wants `socket_addr!(127.0.0.1: port);` to be formatted as `socket_addr!(127.0.0 .1: port);`...

There is an option to exclude a certain macro invocations from being formatted, but

1) the config option parsing seems broken rust-lang/rustfmt#5816
2) the toolchain used in CI doesn't support it

I guess we would have to live with this ugly formatting for some time...

Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
DCNick3 added a commit to hyperledger-iroha/iroha that referenced this issue Jul 6, 2023
`rustfmt` wants `socket_addr!(127.0.0.1: port);` to be formatted as `socket_addr!(127.0.0 .1: port);`...

There is an option to exclude a certain macro invocations from being formatted, but

1) the config option parsing seems broken rust-lang/rustfmt#5816
2) the toolchain used in CI doesn't support it

I guess we would have to live with this ugly formatting for some time...

Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
mversic pushed a commit to hyperledger-iroha/iroha that referenced this issue Oct 17, 2023
`rustfmt` wants `socket_addr!(127.0.0.1: port);` to be formatted as `socket_addr!(127.0.0 .1: port);`...

There is an option to exclude a certain macro invocations from being formatted, but

1) the config option parsing seems broken rust-lang/rustfmt#5816
2) the toolchain used in CI doesn't support it

I guess we would have to live with this ugly formatting for some time...

Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
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 a pull request may close this issue.

1 participant