Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

add rustfmt toml #3491

Merged
merged 2 commits into from
Jul 19, 2021
Merged

add rustfmt toml #3491

merged 2 commits into from
Jul 19, 2021

Conversation

drahnr
Copy link
Contributor

@drahnr drahnr commented Jul 19, 2021

Copies the substrate rustfmt.toml to polkadot, to be used with cargo +nightly fmt or rustfmt +nightly file.rs.

This PR does NOT apply the format, it only provides it to eventually be applied subsystem by subsystem.

Ref paritytech/substrate#8982

@drahnr drahnr self-assigned this Jul 19, 2021
@drahnr drahnr added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit. C1-low PR touches the given topic and has a low impact on builders. labels Jul 19, 2021
Copied from substrate.
Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

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

I wonder whether we really need those nightly features, but since the PR has been merged already, let's keep it consistent.

One thing we might add is a couple more options as suggested in paritytech/substrate#8982 (comment), also maybe edition = "2018"?

It has some odd side effects converting // to /* */ instead of the other way round.
@drahnr
Copy link
Contributor Author

drahnr commented Jul 19, 2021

The reason to revert the normalization of comments is rust-lang/rustfmt#4909

@drahnr
Copy link
Contributor Author

drahnr commented Jul 19, 2021

I wonder whether we really need those nightly features, but since the PR has been merged already, let's keep it consistent.

One thing we might add is a couple more options as suggested in paritytech/substrate#8982 (comment), also maybe edition = "2018"?

Edition is auto detected iff used via cargo +nightly fmt, which is what we should use imho instead of hardcoding, especially with edition = "2021" being around the corner.

Priority was consistency + keeping the changeset small~ish, so I'd rather not meddle too much with the config unless there are specific issues (as stated above i.e.).

@drahnr
Copy link
Contributor Author

drahnr commented Jul 19, 2021

bot merge

@ghost
Copy link

ghost commented Jul 19, 2021

Trying merge.

@andresilva
Copy link
Contributor

Let's make sure the changes here are propagated back to substrate.

@drahnr
Copy link
Contributor Author

drahnr commented Jul 19, 2021

Let's make sure the changes here are propagated back to substrate.

Left a comment on the merged PR and will reach out to @expenses

@drahnr drahnr merged commit 570efba into master Jul 19, 2021
@drahnr drahnr deleted the bernhard-rustfmt-toml branch July 19, 2021 17:12
ordian added a commit that referenced this pull request Jul 20, 2021
* master:
  Update secp256k1 and remove unrequired usage (#3502)
  Bump libc from 0.2.91 to 0.2.98 (#3496)
  Bump slotmap from 1.0.2 to 1.0.5 (#3495)
  Gossip rebroadcast rate limiter (#3494)
  dependabot: ignore another git dep (#3493)
  add rustfmt toml (#3491)
  Disputes runtime (#2947)
  Bump async-process from 1.0.1 to 1.1.0 (#3122)
  remove the kubernetes helm chart (#3483)
  added pallet-proxy in rococo feature dependencies (#3486)
  Update BEEFY+MMR integration. (#3480)
  more verbose asserts (#3476)
  ci: use srtool-actions to build runtimes (#3423)
  overseer gen minor chore fixes (#3479)
@shawntabrizi shawntabrizi mentioned this pull request Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants