Skip to content

Commit 93c6e18

Browse files
committed
feat(rust): use rustfmt.toml for configuring cargo fmt
Replace fmt.toml with new rustfmt.toml Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
1 parent a8f5d78 commit 93c6e18

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

rustfmt.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
comment_width = 100
2+
wrap_comments = true
3+
format_code_in_doc_comments = true
4+
format_strings = true
5+
imports_granularity = "Module"
6+
normalize_comments = true
7+
normalize_doc_attributes = true
8+
group_imports = "StdExternalCrate"

tests/fmt.toml

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/integration_tests/style/test_rust.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ def test_rust_order():
1818

1919
def test_rust_style():
2020
"""Test that rust code passes style checks."""
21-
22-
# ../src/io_uring/src/bindings.rs
23-
config = open("fmt.toml", encoding="utf-8").read().replace("\n", ",")
2421
# Check that the output is empty.
25-
_, stdout, _ = utils.check_output(f"cargo fmt --all -- --check --config {config}")
22+
_, stdout, _ = utils.check_output(f"cargo fmt --all -- --check")
2623

2724
# rustfmt prepends `"Diff in"` to the reported output.
2825
assert "Diff in" not in stdout

tools/devtool

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ cmd_test_debug() {
942942
# Example: `devtool fmt`
943943
#
944944
cmd_fmt() {
945-
cmd_sh "cargo fmt --all -- --config $(tr '\n' ',' <tests/fmt.toml)"
945+
cmd_sh "cargo fmt --all"
946946
cmd_sh "cargo sort"
947947
cmd_sh "cd tests; black --config pyproject.toml . ../tools ../.buildkite"
948948
cmd_sh "cd tests; isort . ../tools ../.buildkite"

0 commit comments

Comments
 (0)