Skip to content

Commit 7d1d103

Browse files
committed
Config snippet & tests for space_around_attr_eq.
1 parent d0e471f commit 7d1d103

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

Configurations.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,6 +2001,28 @@ fn main() {
20012001
}
20022002
```
20032003

2004+
## `space_around_attr_eq`
2005+
2006+
Determines if '=' are wrapped in spaces in attributes.
2007+
2008+
- **Default value**: `true`
2009+
- **Possible values**: `true`, `false`
2010+
- **Stable**: No
2011+
2012+
#### `true` (default):
2013+
2014+
```rust
2015+
#[cfg(not(target_os = "pi"))]
2016+
println!("os is not pi!");
2017+
```
2018+
2019+
#### `false`
2020+
2021+
```rust
2022+
#[cfg(not(target_os="pi"))]
2023+
println!("os is not pi!");
2024+
```
2025+
20042026
## `struct_field_align_threshold`
20052027

20062028
The maximum diff of width between struct fields to be aligned with each other.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-space_around_attr_eq: true
2+
3+
fn attr_eq_test() {
4+
#[cfg(not(target_os="pi"))]
5+
println!("os is not pi!");
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// rustfmt-space_around_attr_eq: true
2+
3+
fn attr_eq_test() {
4+
#[cfg(not(target_os = "pi"))]
5+
println!("os is not pi!");
6+
}

0 commit comments

Comments
 (0)