Page MenuHomePhabricator

[services] Tunnelbroker - Adding a `.rustfmt.toml`to the project root
ClosedPublic

Authored by max on Jul 18 2022, 6:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 6:23 AM
Unknown Object (File)
Fri, Nov 8, 6:09 AM
Unknown Object (File)
Sat, Nov 2, 6:32 PM
Unknown Object (File)
Sat, Nov 2, 6:32 PM
Unknown Object (File)
Sat, Nov 2, 6:32 PM
Unknown Object (File)
Sat, Nov 2, 6:32 PM
Unknown Object (File)
Sat, Nov 2, 6:31 PM
Unknown Object (File)
Sat, Nov 2, 6:20 PM

Details

Summary

To make Rust formatting consistent with the codebase this file adds tab spacing and maximum width rules for the Rust formatting cargo fmt.
We are placing the .rustfmt.toml file at the root of the project. According to the documentation, we can use the project-wide file at the root of the project (parent directory).

The rustfmt.toml files form the sub-directories (services/commtest, services/identity, native/cpp/CommonCpp/CryptoTools/opaque-ke-cxx) were removed.

Linear task: ENG-1330

Test Plan

Running cargo fmt from the Rust workspace directory formats the code according to the standard.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

max held this revision as a draft.
max published this revision for review.Jul 18 2022, 6:16 AM
max retitled this revision from [services] Tunnelbroker - Adding a `rustfmt.toml` for the formatting rules to [services] Tunnelbroker - Adding a `rustfmt.toml` for the Rust formatting rules.
max edited the summary of this revision. (Show Details)
max edited the test plan for this revision. (Show Details)
max added reviewers: karol, varun, jon.
This revision is now accepted and ready to land.Jul 18 2022, 8:17 AM

Is there a way to introduce a universal rustfmt.toml for the whole project?

Is there a way to introduce a universal rustfmt.toml for the whole project?

Yeah, I just looked and this is possible. We can have a single rustfmt.toml in the project root directory

ashoat requested changes to this revision.Jul 18 2022, 12:10 PM

Let's definitely do that. @geekbrother what do you think of changing this diff so it introduces a rustfmt.toml in the root, and deletes the other rustfmt.toml files?

This revision now requires changes to proceed.Jul 18 2022, 12:10 PM

Let's definitely do that. @geekbrother what do you think of changing this diff so it introduces a rustfmt.toml in the root, and deletes the other rustfmt.toml files?

Sure, I'll check it and will make changes.

Moving to use the .rustfmt.toml at the project's root directory.

max retitled this revision from [services] Tunnelbroker - Adding a `rustfmt.toml` for the Rust formatting rules to [services] Tunnelbroker - Adding a `.rustfmt.toml`to the project root.Jul 19 2022, 7:11 AM
max edited the summary of this revision. (Show Details)
max edited the test plan for this revision. (Show Details)

Let's definitely do that. @geekbrother what do you think of changing this diff so it introduces a rustfmt.toml in the root, and deletes the other rustfmt.toml files?

I've placed the .rustfmt.toml file at the root of the project.
According to the documentation, we can use the project-wide file at the root of the project (parent directory).

Running cargo fmt inside the Rust workspace like services/identity formatting the code according to the project's root .rustfmt.toml file.
The workspaces rustfmt.toml files are removed in this diff.
The description of the diff was also updated.

This revision is now accepted and ready to land.Jul 19 2022, 8:46 AM