File: appleswiftformat.vim

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (16 lines) | stat: -rw-r--r-- 540 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
" Author: (bosr) <bosr@bosr.cc>
" Description: Integration of apple/swift-format formatter with ALE.

function! ale#fixers#appleswiftformat#Fix(buffer) abort
    let l:command_args = ale#swift#GetAppleSwiftFormatCommand(a:buffer) . ' format --in-place %t'
    let l:config_args = ale#swift#GetAppleSwiftFormatConfigArgs(a:buffer)

    if l:config_args isnot# ''
        let l:command_args = l:command_args . ' ' . l:config_args
    endif

    return {
    \   'read_temporary_file': 1,
    \   'command': l:command_args,
    \}
endfunction