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

Added support of toolchains for rustfmt #671

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

Conversation

mikebohdan
Copy link

I added the ability to pick a toolchain for rustfmt. This will allow nightly formatting rules while using a non-nightly toolchain.

@github-actions github-actions bot requested a review from stevearc March 14, 2025 00:12
@@ -10,9 +10,11 @@ return {
options = {
-- The default edition of Rust to use when no Cargo.toml file is found
default_edition = "2021",
default_toolchain = "stable",
Copy link
Owner

Choose a reason for hiding this comment

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

The default_edition is only a default because it's what we use if there is no Cargo.toml file. Let's rename this to just toolchain.

Copy link
Owner

Choose a reason for hiding this comment

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

And should add a short comment above to explain it as well

},
args = function(self, ctx)
local args = { "--emit=stdout" }
local toolchain = "+" .. self.options.default_toolchain
Copy link
Owner

Choose a reason for hiding this comment

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

Can you link me to the documentation for passing +<toolchain> to rustfmt? I've seen this for cargo, but would like to read something about how it works for rustfmt.

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.

2 participants