Skip to content

rustfmt --config-help should not display hidden options #2300

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
nrc opened this issue Dec 21, 2017 · 6 comments
Closed

rustfmt --config-help should not display hidden options #2300

nrc opened this issue Dec 21, 2017 · 6 comments
Labels
bug Panic, non-idempotency, invalid code, etc. good first issue Issues up for grabs, also good candidates for new rustfmt contributors

Comments

@nrc
Copy link
Member

nrc commented Dec 21, 2017

such as width_heuristics.

reported in #2299

@nrc nrc added bug Panic, non-idempotency, invalid code, etc. good first issue Issues up for grabs, also good candidates for new rustfmt contributors labels Dec 21, 2017
@choubacha
Copy link
Contributor

@nrc How do we know which options are hidden?

@nrc
Copy link
Member Author

nrc commented Dec 27, 2017

@kbacha there are some comments in config.rs, iirc, it's only like three options

@vishalsodani
Copy link
Contributor

I would like to take a shot at this. I see 3 options verbose, file_lines and width_heuristics mentioned under "not user facing".

I have attempted to hide these 3 options on running 'config-help' by modifying print_docs(). I added a vector -
let bypass = vec!["verbose", "file_lines", "width_heuristics"];
and just checked
if !bypass.contains(&name_raw)

Is this the way to go?

@nrc
Copy link
Member Author

nrc commented Jan 4, 2018

@vishalsodani sorry for the late reply, I think that approach is fine, however, I would make bypass a const in config.rs, rather than a local variable (which means using an array, rather than Vec).

@vishalsodani
Copy link
Contributor

@nrc Thanks! Do I need to write test for this change? If yes, where or how do I go about writing the test?

@nrc
Copy link
Member Author

nrc commented Jan 4, 2018

@vishalsodani nah, I don't think this needs a test

@nrc nrc closed this as completed in 3345b00 Jan 4, 2018
nrc added a commit that referenced this issue Jan 4, 2018
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