Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit 793d816

Browse files
committed
Tests: Fix several failures related to formatter precedence
Fixes several vroom tests that wrongly assume their formatter will be the default for a given filetype and started failing when I reordered the formatter registrations in b1b5109. Note those precedence changes could really affect users, but only if they're relying on defaults and have multiple installed formatters for those same filetypes. If so, it's easily resolved by explicitly specifying a formatter name or uninstalling unwanted formatters.
1 parent c84463d commit 793d816

File tree

3 files changed

+13
-21
lines changed

3 files changed

+13
-21
lines changed

vroom/autopep8.vroom

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,6 @@ You can format any buffer with autopep8 specifying the formatter explicitly.
6060
pass
6161
@end
6262

63-
The python filetype will use the autopep8 formatter by default.
64-
65-
@clear
66-
% pass
67-
68-
:set filetype=python
69-
:FormatCode
70-
! autopep8 .*
71-
$ pass
72-
73-
:set filetype=
74-
7563
It can format specific line ranges of code using :FormatLines.
7664

7765
@clear

vroom/clangformat.vroom

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@ You can format any buffer with clang-format specifying the formatter explicitly.
7575
}
7676
@end
7777

78-
Several filetypes will use the clang-format formatter by default: c, cpp,
79-
javascript, and proto. If the version of clang-format is >= 3.6, then it will
80-
also format java files, but google-java-format is the default.
78+
Several filetypes will use the clang-format formatter by default: c, cpp, and
79+
proto.
8180

8281
@clear
8382
% f();
@@ -88,14 +87,18 @@ also format java files, but google-java-format is the default.
8887
$ { "Cursor": 0 }
8988
$ f();
9089

91-
:set filetype=javascript
90+
:set filetype=proto
9291
:FormatCode
9392
! clang-format .*
9493
$ { "Cursor": 0 }
9594
$ f();
9695

97-
:set filetype=proto
98-
:FormatCode
96+
It will also format javascript and java, but is not necessarily the default if
97+
other formatters are available.
98+
Note: Formatting java requires clang-format >= 3.6.
99+
100+
:set filetype=javascript
101+
:FormatCode clang-format
99102
! clang-format .*
100103
$ { "Cursor": 0 }
101104
$ f();
@@ -144,6 +147,7 @@ a string value to use everywhere...
144147

145148
:Glaive codefmt clang_format_style='WebKit'
146149

150+
@clear
147151
% f();
148152
:FormatCode clang-format
149153
! clang-format -style WebKit .*2>.*

vroom/jsbeautify.vroom

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ here we specify js-beautify explicitly.
7070
$ f();
7171

7272
:set filetype=json
73-
:FormatCode
73+
:FormatCode js-beautify
7474
! js-beautify -f - --type js 2>.*
7575
$ f();
7676

7777
:set filetype=html
78-
:FormatCode
78+
:FormatCode js-beautify
7979
! js-beautify -f - --type html 2>.*
8080
$ f();
8181

8282
:set filetype=css
83-
:FormatCode
83+
:FormatCode js-beautify
8484
! js-beautify -f - --type css 2>.*
8585
$ f();
8686

0 commit comments

Comments
 (0)