Skip to content

cargo fmt: missing linebreak in error message #3644

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

Closed
matthiaskrgr opened this issue Jun 22, 2019 · 3 comments
Closed

cargo fmt: missing linebreak in error message #3644

matthiaskrgr opened this issue Jun 22, 2019 · 3 comments
Labels
bug Panic, non-idempotency, invalid code, etc. good first issue Issues up for grabs, also good candidates for new rustfmt contributors
Milestone

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Jun 22, 2019

./target/debug/cargo-fmt -p wasd

The error message is:

[...]
ARGS:
    <rustfmt_options>...    Options passed to rustfmt%

looks like there is a final linebreak missing after the --help output.
(it should be Options passed to rustfmt\n instead of Options passed to rustfmt)

rustfmt

@topecongiro topecongiro added bug Panic, non-idempotency, invalid code, etc. good first issue Issues up for grabs, also good candidates for new rustfmt contributors labels Jun 23, 2019
@topecongiro topecongiro added this to the 1.3.1 milestone Jun 24, 2019
@nootanghimire
Copy link
Contributor

nootanghimire commented Jun 24, 2019

Heya!

Really new to rust, but would like to start contributing small things! I looked into the code, and it seems this could either be solved by adding:

app.after_help("\n").write_help....;

to cargo-fmt/main.rs:98 -- or maybe solving it for everyone in the clap crate. (i.e., if I followed the code correctly and this is using clap)

It would be great if anyone could comment on which approach would be better.

Cheers!

@nootanghimire
Copy link
Contributor

Turns out that the after_help hook adds a newline at the end without having to explicitly writing it, I'll create a PR. :)

@topecongiro
Copy link
Contributor

Closed via #3650. @nootanghimire Thank you for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Panic, non-idempotency, invalid code, etc. good first issue Issues up for grabs, also good candidates for new rustfmt contributors
Projects
None yet
Development

No branches or pull requests

3 participants