Commit 5ea4017
fix(fmt): tune rustfmt rules for ink! macros (#852)
* fix(fmt): tune rustfmt rules for ink! macros (#783)
- Add rust-toolchain.toml pinning nightly channel with rustfmt and
clippy components so every contributor uses the same formatter.
- Add rustfmt.toml with format_macro_matchers = true (nightly-only)
so #[ink::contract], #[ink::test] and non_reentrant! macro calls
are fully formatted. Also sets format_macro_bodies, edition 2021,
max_width 100 and a handful of import-ordering options.
- Update smoke-ci.yml: install nightly rustfmt in a dedicated step
and run 'cargo +nightly fmt --check' instead of stable fmt.
Stable toolchain is still used for clippy and tests.
Closes #783
* fix(ci): install nightly rustfmt before fmt check to fix CI failure
The rust-toolchain.toml file alone does not auto-install rustfmt
for nightly when cargo +nightly is invoked in CI after the stable
toolchain has been explicitly installed. Add an explicit dtolnay/rust-toolchain@nightly
step with the rustfmt component before running cargo +nightly fmt --check.
* fix(fmt): apply cargo +nightly fmt with format_macro_matchers
---------
Co-authored-by: husten150 <hustenisama@gmail.com>1 parent be7f6ef commit 5ea4017
31 files changed
Lines changed: 104 additions & 74 deletions
File tree
- .github/workflows
- contracts
- bridge/src
- compliance_registry
- crowdfunding/src
- dex/src
- factory/src
- fractional/src
- hello-world/src
- insurance/src
- lending/src
- lib/src
- mock-oracle/src
- multicall/src
- oracle/src
- property-management/src
- traits/src
- version-registry/src
- security-audit/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | | - | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| |||
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
47 | | - | |
48 | | - | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | | - | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
1428 | 1430 | | |
1429 | 1431 | | |
1430 | 1432 | | |
1431 | | - | |
1432 | 1433 | | |
1433 | 1434 | | |
1434 | 1435 | | |
1435 | 1436 | | |
| 1437 | + | |
| 1438 | + | |
1436 | 1439 | | |
1437 | 1440 | | |
1438 | 1441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
1196 | 1195 | | |
1197 | 1196 | | |
1198 | 1197 | | |
1199 | | - | |
1200 | 1198 | | |
1201 | 1199 | | |
| 1200 | + | |
| 1201 | + | |
1202 | 1202 | | |
1203 | 1203 | | |
1204 | 1204 | | |
| |||
1894 | 1894 | | |
1895 | 1895 | | |
1896 | 1896 | | |
1897 | | - | |
1898 | 1897 | | |
1899 | 1898 | | |
| 1899 | + | |
| 1900 | + | |
1900 | 1901 | | |
1901 | 1902 | | |
1902 | 1903 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
| 6 | + | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
87 | | - | |
88 | | - | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
1701 | 1702 | | |
1702 | 1703 | | |
1703 | 1704 | | |
1704 | | - | |
1705 | 1705 | | |
1706 | 1706 | | |
| 1707 | + | |
| 1708 | + | |
1707 | 1709 | | |
1708 | 1710 | | |
1709 | 1711 | | |
| |||
1797 | 1799 | | |
1798 | 1800 | | |
1799 | 1801 | | |
1800 | | - | |
1801 | 1802 | | |
1802 | 1803 | | |
| 1804 | + | |
| 1805 | + | |
1803 | 1806 | | |
1804 | 1807 | | |
1805 | 1808 | | |
| |||
0 commit comments