Skip to content

add canonical rustfmt#189

Open
TheButlah wants to merge 1 commit intoBiagioFesta:masterfrom
TheButlah:thebutlah/add-rustfmt
Open

add canonical rustfmt#189
TheButlah wants to merge 1 commit intoBiagioFesta:masterfrom
TheButlah:thebutlah/add-rustfmt

Conversation

@TheButlah
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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