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

Add rustfmt to normalize formatting #2589

Merged
merged 3 commits into from
Mar 23, 2021
Merged

Conversation

antgamdia
Copy link
Contributor

Description of the change

Similary, as we already to in js and go (I guess), this PR brings the configuration for the rust prettifier, the rustfmt tool. It implements the Rust Style Guide.

Benefits

We'll have a consistent code formatting config so that multiple devs have the same linitng rules.

Possible drawbacks

N/A

Applicable issues

N/A

Additional information

I've used the default config for the generation of the .rustfmt.toml feel free to suggest other configurations.

Copy link
Contributor

@absoludity absoludity left a comment

Choose a reason for hiding this comment

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

Thanks! I actually thought I had rustfmt running in vscode on save, but obviously not :)

@@ -0,0 +1,68 @@
max_width = 100
Copy link
Contributor

Choose a reason for hiding this comment

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

If these are all defaults, can we not specify them instead? (ie. I think it's much easier to reason about if this file only has the exceptions to the defaults that we want, if any)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I agree. I just wanted to commit all the options to discuss if we should change something else.
However, these options can be retrieved from rustfmt --print-config default

Thanks! I actually thought I had rustfmt running in vscode on save, but obviously not :)

I thought the same, but I broke something in my vscode config and it stopped working. Then I realized I was using the default formatter in vscode and not the rustfmt one.

@antgamdia antgamdia merged commit cfd6c48 into vmware-tanzu:master Mar 23, 2021
@antgamdia antgamdia deleted the rustfmt branch March 23, 2021 11:32
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.

None yet

2 participants