@@ -50,6 +50,7 @@ The current list of defaults by filetype is:
50
50
* nix: nixpkgs-fmt
51
51
* ocaml: ocamlformat
52
52
* python: autopep8, black, yapf
53
+ * ruby: rubocop
53
54
* rust: rustfmt
54
55
* sh: shfmt
55
56
* swift: swift-format
@@ -183,6 +184,10 @@ Default: [] `
183
184
The path to the swift-format executable.
184
185
Default: 'swift-format' `
185
186
187
+ *codefmt:rubocop_executable*
188
+ The path to the Rubocop executable.
189
+ Default: 'rubocop' `
190
+
186
191
*codefmt:prettier_executable*
187
192
The path to the prettier executable. String, list, or callable that takes no
188
193
args and returns a string or a list. The default uses npx if available, so
@@ -383,7 +388,8 @@ codefmt#formatterhelpers#Format({cmd}) *codefmt#formatterhelpers#Format()*
383
388
Throws ERROR(ShellError) if the {cmd} system call fails
384
389
385
390
codefmt#formatterhelpers#AttemptFakeRangeFormatting({startline} , {endline} ,
386
- {cmd} , {ignoreerrors} , {skipfirstnlines} ) *codefmt#formatterhelpers#AttemptFakeRangeFormatting()*
391
+ {cmd} , [ignoreerrors] , [skipfirstnlines] )
392
+ *codefmt#formatterhelpers#AttemptFakeRangeFormatting()*
387
393
Attempt to format a range of lines from {startline} to {endline} in the
388
394
current buffer via a formatter that doesn't natively support range
389
395
formatting, which is invoked via {cmd} (a system call represented by either
@@ -396,7 +402,18 @@ codefmt#formatterhelpers#AttemptFakeRangeFormatting({startline}, {endline},
396
402
the tool for range formatting and post a URL for that feature request above
397
403
code that calls it.
398
404
399
- Throws ERROR(ShellError) if the {cmd} system call fails
405
+ If [ignoreerrors] is nonzero, the syscall ignores errors. This can be
406
+ helpful for formatters that return nonzero results for reasons unrelated to
407
+ formatting.
408
+
409
+ If [skipfirstnlines] is set to a nonzero number N, the first N lines of the
410
+ formatter output are trimmed. This can be used to trim always-present
411
+ headers.
412
+
413
+ [ignoreerrors] is 0 if omitted.
414
+ [skipfirstnlines] is 0 if omitted.
415
+ Throws ERROR(ShellError) if the {cmd} system call fails (and [ignoreerrors]
416
+ is 0)
400
417
Throws ERROR(WrongType)
401
418
402
419
codefmt#formatterhelpers#ResolveFlagToArray({flag_name})
0 commit comments