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

add canonical rustfmt #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TheButlah
Copy link
Contributor

@TheButlah TheButlah commented Jun 20, 2024

Its nice to have a vendored rustfmt.toml. because when people use settings that differ from the defaults, the rustfmt.toml will take precedence.

@BiagioFesta
Copy link
Owner

I use a specific rustfmt.toml locally, I'd like to vendor it, but many useful option are nightly at the moment.

My local:

imports_granularity = "Item"
format_code_in_doc_comments = true

and that's why I ignored it for now.

  • It is good to vendor a +nightly configuration?
  • I'd prefer to vendor with filename .rustfmt.toml (hidden file); that should help keeping root directly a little bit "cleaner"

Copy link
Owner

@BiagioFesta BiagioFesta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably better .rustfmt.toml

@TheButlah
Copy link
Contributor Author

It is good to vendor a +nightly configuration?

I know some people do this, but since it eliminates the ability to use standard toolchain pinning via rust-toolchain (if you also want to build with stable), I don't personally advocate for nightly rustfmt.

@MOZGIII
Copy link
Contributor

MOZGIII commented Jul 15, 2024

I think I know a good setup for this:

  • set rust-toolchain.toml to use nightly
  • vendor the nightly rustfmt settings
  • at CI run tests and clippy against stable and the rest targets
  • check rustfmt against nightly (version specified via the toml)

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.

3 participants