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

Make CLI colors an enum #2654

Closed
wants to merge 1 commit into from
Closed

Make CLI colors an enum #2654

wants to merge 1 commit into from

Conversation

levkk
Copy link
Contributor

@levkk levkk commented Nov 27, 2023

  1. Make cli_colors an enum that accepts "auto", "always" and "never" just like cargo --color. Acts the same way. Backwards compatible: 0 = never, 1 = auto, false = never, true = auto. Fix Force enable color output #2649
  2. Ran cargo fmt. The diff is huge, not sure what happened...did we not run cargo fmt in a long time or does it accept some settings I should tweak on my side to make formatting consistent with the project? $ cargo fmt --version rustfmt 1.6.0-stable (d5c2e9c 2023-09-13)

@SergioBenitez
Copy link
Member

Please don't run cargo fmt. We don't use it because it doesn't format code the way we need it to.

@levkk
Copy link
Contributor Author

levkk commented Nov 27, 2023

Do you have a formatter I can use or should I just format the code manually?

@SergioBenitez
Copy link
Member

SergioBenitez commented Nov 27, 2023

Manual formatting matching the existing style of the surrounding code is what we recommend.

@levkk
Copy link
Contributor Author

levkk commented Nov 27, 2023

I don't think that's going to work for me. cargo fmt is a reflex I've acquired over the years, not entirely sure why we want to regress to C-style development here. If not me, the next contributor who's going to run it is going to waste their time either starting their PR from scratch or reformatting the code back manually.

Let me know if this policy changes, I'll be happy to contribute this and more to Rocket! It's by far my favorite framework and I'd love to help with development.

@SergioBenitez
Copy link
Member

I don't think that's going to work for me. cargo fmt is a reflex I've acquired over the years, not entirely sure why we want to regress to C-style development here.

I understand if this makes you uncomfortable. If choosing not to execute a command is where you draw the line in terms of contributing, I completely respect that decision.

If not me, the next contributor who's going to run it is going to waste their time either starting their PR from scratch or reformatting the code back manually.

Absolutely, I understand the importance of clarity. In our README, we've included a concise "Contributing" section. In the emboldened Styled point, we've highlighted the expectation to match the existing code style. It's my sincere hope that contributors take a moment to review this section beforehand, which ideally minimizes the need for adjustments afterward.

Let me know if this policy changes, I'll be happy to contribute this and more to Rocket! It's by far my favorite framework and I'd love to help with development.

I've added a rustfmt.toml in 7f7d352 which hopefully assuages your concerns. We'd love to have you, and anyone else, as contributors to the project.

@levkk
Copy link
Contributor Author

levkk commented Nov 29, 2023

Thanks, appreciate your thoughts and your work on Rocket. I'll write up a PR implementing this without the formatting.

Edit: this is also a great git lesson for me: before making potentially large changes to the code base...make a commit.

@levkk
Copy link
Contributor Author

levkk commented Nov 29, 2023

#2656

@levkk levkk closed this Nov 29, 2023
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 this pull request may close these issues.

Force enable color output
2 participants