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

Have an enforced code style #8981

Closed
expenses opened this issue Jun 1, 2021 · 9 comments
Closed

Have an enforced code style #8981

expenses opened this issue Jun 1, 2021 · 9 comments
Assignees

Comments

@expenses
Copy link
Contributor

expenses commented Jun 1, 2021

At the moment, we don't have any setup for code formatters such as cargo fmt. This means that developers manually have to do things such as break off lines at the appropriate column wide. These things take up time needlessly and I think it'd be better to have an enforced, consistent style across the codebase.

My proposal for this would be to have a rustfmt.toml that conforms to the existing style of the codebase as much as possible. We could then run cargo fmt on CI, or request that PR authors run it.

@expenses
Copy link
Contributor Author

expenses commented Jun 1, 2021

This is also mentioned briefly here: https://hackmd.io/u_HZ86QHRm2Rp1gG1b2R1g?view

@gilescope
Copy link
Contributor

Most of substrate's clients will expect cargo fmt. If rustc can do it then I can't see why we can't.

@gui1117
Copy link
Contributor

gui1117 commented Jun 2, 2021

@expenses expenses self-assigned this Jun 3, 2021
@gilescope
Copy link
Contributor

Not unexpected. Perfection is impossible, but consistency is possible. We will not be able to rust fmt the codebase in a way that everyone is happy with, but perhaps we can do it such that no one person is too unhappy with the result. That would be a win.

@stale
Copy link

stale bot commented Jul 7, 2021

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Jul 7, 2021
@gui1117
Copy link
Contributor

gui1117 commented Jul 8, 2021

I still find the issue relevant, we should conclude on the opened PR

@stale stale bot removed the A5-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. label Jul 8, 2021
@gilescope
Copy link
Contributor

gilescope commented Jul 11, 2021 via email

@gilescope
Copy link
Contributor

We can close this issue now or should we do the same for polkadot?

@bkchr
Copy link
Member

bkchr commented Jul 26, 2021

Can be closed now.

@bkchr bkchr closed this as completed Jul 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants