File tree Expand file tree Collapse file tree 9 files changed +22
-1
lines changed Expand file tree Collapse file tree 9 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ Linters which are not language-specific:
51
51
| TSX | [ Prettier] | [ ESLint] |
52
52
| TypeScript | [ Prettier] | [ ESLint] |
53
53
| YAML | [ yamlfmt] | |
54
+ | XML | [ prettier/plugin-xml] | |
54
55
55
56
[ prettier ] : https://prettier.io
56
57
[ google-java-format ] : https://github.com/google/google-java-format
@@ -68,6 +69,7 @@ Linters which are not language-specific:
68
69
[ ktlint ] : https://github.com/pinterest/ktlint
69
70
[ buildifier ] : https://github.com/keith/buildifier-prebuilt
70
71
[ prettier-plugin-sql ] : https://github.com/un-ts/prettier
72
+ [ prettier/plugin-xml ] : https://github.com/prettier/plugin-xml
71
73
[ gofmt ] : https://pkg.go.dev/cmd/gofmt
72
74
[ gofumpt ] : https://github.com/mvdan/gofumpt
73
75
[ jsonnetfmt ] : https://github.com/google/go-jsonnet
Original file line number Diff line number Diff line change 9
9
"eslint" : " ^9.16.0" ,
10
10
"prettier" : " ^2.8.7" ,
11
11
"prettier-plugin-sql" : " ^0.14.0" ,
12
+ "@prettier/plugin-xml" : " ^0.10.0" ,
12
13
"stylelint" : " ^16" ,
13
14
"stylelint-config-standard" : " ^36.0.1" ,
14
15
"typescript" : " 4.9.5" ,
Original file line number Diff line number Diff line change
1
+ <hello >
2
+ <world >
3
+ todo</world >
4
+ </hello >
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ format_multirun(
93
93
swift = ":swiftformat" ,
94
94
terraform = "@aspect_rules_lint//format:terraform" ,
95
95
visibility = ["//:__subpackages__" ],
96
+ xml = ":prettier" ,
96
97
yaml = "@aspect_rules_lint//format:yamlfmt" ,
97
98
)
98
99
Original file line number Diff line number Diff line change @@ -142,6 +142,9 @@ function ls-files {
142
142
' TypeScript' ) patterns=(' *.ts' ' *.cts' ' *.mts' ) ;;
143
143
' Vue' ) patterns=(' *.vue' ) ;;
144
144
' YAML' ) patterns=(' *.yml' ' *.yaml' ' .clang-format' ' .clang-tidy' ' .gemrc' ) ;;
145
+ # Note: https://github.com/github-linguist/linguist/blob/559a6426942abcae16b6d6b328147476432bf6cb/lib/linguist/languages.yml#L7767-L7882
146
+ # has a giant list of patterns. We arbitrarily choose some "common" ones.
147
+ ' XML' ) patterns=(' *.xml' ' *.xsd' ) ;;
145
148
146
149
# Note: terraform fmt cannot handle all HCL files such as .terraform.lock
147
150
# "Only .tf and .tfvars files can be processed with terraform fmt"
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ TOOLS = {
26
26
"Cuda" : "clang-format" ,
27
27
"YAML" : "yamlfmt" ,
28
28
"Rust" : "rustfmt" ,
29
+ "XML" : "prettier" ,
29
30
}
30
31
31
32
# Provided to make install more convenient
Original file line number Diff line number Diff line change @@ -57,5 +57,6 @@ format_multirun(
57
57
swift = ":mock_swiftformat.sh" ,
58
58
# TODO: this attribute should be renamed to hcl
59
59
terraform = ":mock_terraform-fmt.sh" ,
60
+ xml = ":mock_prettier.sh" ,
60
61
yaml = ":mock_yamlfmt.sh" ,
61
62
)
Original file line number Diff line number Diff line change @@ -40,6 +40,13 @@ bats_load_library "bats-assert"
40
40
assert_output --partial " + prettier --write .bcr/README.md CONTRIBUTING.md README.md"
41
41
}
42
42
43
+ @test " should run prettier on XML" {
44
+ run bazel run //format/test:format_XML_with_prettier
45
+ assert_success
46
+
47
+ assert_output --partial " + prettier --write example/checkstyle-suppressions.xml"
48
+ }
49
+
43
50
@test " should run prettier on CSS" {
44
51
run bazel run //format/test:format_CSS_with_prettier
45
52
assert_success
You can’t perform that action at this time.
0 commit comments