mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-03 10:03:47 +08:00
Add scadformat fixer for OpenSCAD (#4808)
Add scadformat to ALE --------- Co-authored-by: w0rp <w0rp@users.noreply.github.com>
This commit is contained in:
@@ -697,6 +697,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['ruby'],
|
||||
\ 'description': 'A formatter for Ruby source code',
|
||||
\ },
|
||||
\ 'scadformat': {
|
||||
\ 'function': 'ale#fixers#scadformat#Fix',
|
||||
\ 'suggested_filetypes': ['openscad'],
|
||||
\ 'description': 'Formatter for scad files',
|
||||
\ },
|
||||
\ 'cljfmt': {
|
||||
\ 'function': 'ale#fixers#cljfmt#Fix',
|
||||
\ 'suggested_filetypes': ['clojure'],
|
||||
|
||||
15
autoload/ale/fixers/scadformat.vim
Normal file
15
autoload/ale/fixers/scadformat.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Author: tony o'dell <tony.odell@live.com>
|
||||
" Description: Fix scad files with scadformat
|
||||
|
||||
call ale#Set('openscad_scadformat_executable', 'scadformat')
|
||||
call ale#Set('openscad_scadformat_options', '')
|
||||
|
||||
function! ale#fixers#scadformat#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'openscad_scadformat_executable')
|
||||
let l:options = ale#Var(a:buffer, 'openscad_scadformat_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user