fuel-core icon indicating copy to clipboard operation
fuel-core copied to clipboard

Add rustfmt rules to the project.

Open xgreenx opened this issue 2 years ago • 4 comments

Added rustfmt rules. I used my favorite rules but we can discuss your wishes=) It requires usage of nightly rustfmt because it contains many new configurations. Formatted the whole project, so it will make ongoing PR harder(you need to fix conflicts) Added CI to check the fmt.

xgreenx avatar Aug 22 '22 10:08 xgreenx

You can check what the code looks like and decide whether it is okay or not=) And maybe better to merge other PR first before this one.

xgreenx avatar Aug 22 '22 10:08 xgreenx

We actually can remove it because it is very fas check(~10 seconds) =)

xgreenx avatar Aug 23 '22 13:08 xgreenx

I think its a good thing to have a fmt standard. But then if we are diverging from the default of rustfmt, we might want to enforce that to all our repos so we don't end up having different styles across the org

Yea, if we are okay to apply rustfmt for fuel-core then better to do the same for all rust repos=)

xgreenx avatar Aug 23 '22 15:08 xgreenx

If this requires an org-wide change then it should have org-wide buy-in. Might be time to follow-up on https://github.com/FuelLabs/rfcs/pull/8

adlerjohn avatar Aug 23 '22 17:08 adlerjohn

Reviewed all the config options, apart from maybe imports_granularity = "Crate/Module" I don't see much use in enforcing other ones, that is, diverging from the default values.

leviathanbeak avatar Sep 05 '22 15:09 leviathanbeak

@adlerjohn we need to update the ci requirements on the repo to merge this pr

Voxelot avatar Sep 05 '22 19:09 Voxelot

@xgreenx can you also update CONTRIBUTING.md with the updated instructions for running the nightly formatter?

Voxelot avatar Sep 06 '22 22:09 Voxelot