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

Run rustfmt with nightly #1049

Merged
merged 1 commit into from
Aug 2, 2023
Merged

Run rustfmt with nightly #1049

merged 1 commit into from
Aug 2, 2023

Conversation

luckysori
Copy link
Contributor

We must do this if we want dprint to respect some of the unstable options we have configured in our rustfmt.toml. This is what we get if we run cargo fmt (as opposed to cargo +nightly fmt):

Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 100`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Item`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = One`, unstable features are only available in nightly channel.

After running dprint fmt with the new configuration we can see that the autoformatter consistently applies group_imports = One to our codebase.

@luckysori luckysori self-assigned this Aug 2, 2023
We must do this if we want `dprint` to respect some of the unstable
options we have configured in our `rustfmt.toml`. This is what we get
if we run `cargo fmt` (as opposed to `cargo +nightly fmt`):

```
Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
Warning: can't set `comment_width = 100`, unstable features are only available in nightly channel.
Warning: can't set `imports_granularity = Item`, unstable features are only available in nightly channel.
Warning: can't set `group_imports = One`, unstable features are only available in nightly channel.
```

After running `dprint fmt` with the new configuration we can see that
the autoformatter consistently applies `group_imports = One` to our
codebase.
Copy link
Contributor

@bonomat bonomat left a comment

Choose a reason for hiding this comment

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

Fine with me

@luckysori luckysori added this pull request to the merge queue Aug 2, 2023
Merged via the queue into main with commit de4437d Aug 2, 2023
7 checks passed
@luckysori luckysori deleted the fix/dprint-rustfmt-nightly branch August 2, 2023 09:57
@Restioson Restioson mentioned this pull request Aug 2, 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.

2 participants