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

@ -546,7 +546,7 @@ const max_latin_1 = rune(0x00ff)
// Represents all unicode in unicode category L.
const letter_table = RangeTable{
r16: [
r16: [
Range16{0x0041, 0x005a, 1},
Range16{0x0061, 0x007a, 1},
Range16{0x00aa, 0x00b5, 11},
@ -907,7 +907,7 @@ const letter_table = RangeTable{
Range16{0xffd2, 0xffd7, 1},
Range16{0xffda, 0xffdc, 1},
]
r32: [
r32: [
Range32{0x10000, 0x1000b, 1},
Range32{0x1000d, 0x10026, 1},
Range32{0x10028, 0x1003a, 1},
@ -1141,7 +1141,7 @@ const letter_table = RangeTable{
// Represents all unicodes in unicode category Z with property white space.
const white_space_table = RangeTable{
r16: [
r16: [
Range16{0x0009, 0x000d, 1},
Range16{0x0020, 0x0085, 101},
Range16{0x00a0, 0x1680, 5600},
@ -1156,7 +1156,7 @@ const white_space_table = RangeTable{
// Represents all unicodes in unicode category N.
const number_table = RangeTable{
r16: [
r16: [
Range16{0x0030, 0x0039, 1},
Range16{0x00b2, 0x00b3, 1},
Range16{0x00b9, 0x00bc, 3},
@ -1224,7 +1224,7 @@ const number_table = RangeTable{
Range16{0xabf0, 0xabf9, 1},
Range16{0xff10, 0xff19, 1},
]
r32: [
r32: [
Range32{0x10107, 0x10133, 1},
Range32{0x10140, 0x10178, 1},
Range32{0x1018a, 0x1018b, 1},

View file

@ -10,7 +10,7 @@ fn test_node() {
'test:key': ' test_value '
'test:other': '123456'
}
children: [
children: [
xml.XMLNode{
name: 'child'
attributes: {
@ -25,7 +25,7 @@ fn test_node() {
attributes: {
'k': 'v'
}
children: [
children: [
'Hello, world!',
xml.XMLNode{
name: 'c'
@ -41,7 +41,7 @@ fn test_node() {
'uri': '{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}'
'xmlns:xcalcf': 'http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures'
}
children: [
children: [
xml.XMLNode{
name: 'xcalcf:calcFeatures'
children: [
@ -130,7 +130,7 @@ fn test_doc() {
'test:key': ' test_value '
'test:other': '123456'
}
children: [
children: [
xml.XMLNode{
name: 'child'
attributes: {
@ -147,7 +147,7 @@ fn test_doc() {
attributes: {
'k': 'v'
}
children: [
children: [
'Hello, world!',
xml.XMLNode{
name: 'c'

View file

@ -31,7 +31,7 @@ const xml_elements = [
attributes: {
'id': 'c2'
}
children: [
children: [
'Sample Text',
]
},
@ -80,7 +80,7 @@ const xml_elements = [
attributes: {
'id': 'c9'
}
children: [
children: [
'More Sample Text',
]
},

View file

@ -36,13 +36,13 @@ fn test_large_gtk_file() ! {
'name': 'new'
'c:identifier': 'gtk_window_new'
}
children: [
children: [
xml.XMLNodeContents(xml.XMLNode{
name: 'doc'
attributes: {
'xml:space': 'preserve'
}
children: [
children: [
xml.XMLNodeContents('Creates a new `GtkWindow`.
To get an undecorated window (no window borders), use
@ -62,13 +62,13 @@ To delete a `GtkWindow`, call [method@Gtk.Window.destroy].'),
attributes: {
'transfer-ownership': 'none'
}
children: [
children: [
xml.XMLNodeContents(xml.XMLNode{
name: 'doc'
attributes: {
'xml:space': 'preserve'
}
children: [xml.XMLNodeContents('a new `GtkWindow`.')]
children: [xml.XMLNodeContents('a new `GtkWindow`.')]
}),
xml.XMLNodeContents(xml.XMLNode{
name: 'type'
@ -76,7 +76,7 @@ To delete a `GtkWindow`, call [method@Gtk.Window.destroy].'),
'name': 'Widget'
'c:type': 'GtkWidget*'
}
children: []
children: []
}),
]
}),

View file

@ -10,7 +10,7 @@ fn test_valid_parsing() ! {
text: ' Employee Information'
},
]
root: xml.XMLNode{
root: xml.XMLNode{
name: 'address'
children: [
xml.XMLComment{

View file

@ -35,7 +35,7 @@ fn test_valid_parsing() {
]
}
}
root: xml.XMLNode{
root: xml.XMLNode{
name: 'note'
children: [
xml.XMLNode{

View file

@ -12,21 +12,21 @@ fn test_valid_parsing() {
attributes: {
'category': 'web'
}
children: [
children: [
xml.XMLNode{
name: 'title'
attributes: {
'lang': 'en'
'code:type': 'const char*'
}
children: ['Learning XML']
children: ['Learning XML']
},
xml.XMLNode{
name: 'author'
attributes: {
'attr': ' surrounding spaces '
}
children: ['Erik T. Ray']
children: ['Erik T. Ray']
},
xml.XMLNode{
name: 'year'

View file

@ -13,7 +13,7 @@ fn test_valid_parsing() {
'count': '5'
'uniqueCount': '5'
}
children: [
children: [
xml.XMLNode{
name: 'si'
children: [
@ -22,7 +22,7 @@ fn test_valid_parsing() {
attributes: {
'a': '1'
}
children: ['Item 1']
children: ['Item 1']
},
]
},