fmt: fix formating a file in an oscillating manner (fix #22223, fix #22026) (#22232)

This commit is contained in:
yuyi 2024-09-17 14:47:38 +08:00 committed by GitHub
parent c004d0c899
commit acf6b344f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
99 changed files with 681 additions and 655 deletions

View file

@ -210,4 +210,4 @@ fn main() {
println('an_int: ${an_int} | a_bool: ${a_bool} | a_float: ${a_float} | a_string: "${a_string}" ')
println(additional_args.join_lines())
}
```
```

View file

@ -340,7 +340,7 @@ pub fn to_doc[T](dc DocConfig) !string {
delimiter: dc.delimiter
style: dc.style
}
input: []
input: []
}
fm.si = fm.get_struct_info[T]()!
return fm.to_doc(dc)!

View file

@ -176,20 +176,20 @@ fn test_flag_to_doc_spacing_and_new_lines() {
assert flag.to_doc[DocTest](
description: 'Flag to doc test.
Content here'
footer: '
footer: '
Footer content'
fields: unsafe { field_docs }
fields: unsafe { field_docs }
)! == doc4
// Test in compact mode also
assert flag.to_doc[DocTest](
options: flag.DocOptions{
options: flag.DocOptions{
compact: true
}
description: 'Flag to doc test.
Content here'
footer: '
footer: '
Footer content'
fields: unsafe { field_docs }
fields: unsafe { field_docs }
)! == doc5
}