Add scadformat fixer for OpenSCAD (#4808)

Add scadformat to ALE

---------

Co-authored-by: w0rp <w0rp@users.noreply.github.com>
This commit is contained in:
tony-o
2025-03-11 13:00:03 +00:00
committed by GitHub
parent b26608681d
commit 92753662a7
8 changed files with 63 additions and 0 deletions

View File

@@ -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'],

View 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