summaryrefslogtreecommitdiff
path: root/ale_linters
diff options
context:
space:
mode:
authorNathan Henrie <n8henrie@users.noreply.github.com>2022-08-07 01:27:17 -0600
committerGitHub <noreply@github.com>2022-08-07 16:27:17 +0900
commit5063804d44fe149ed39149848f92b5960f4f7164 (patch)
treecab553ae5166a556ab5b2a57d81f86c29a97e707 /ale_linters
parente10fcf22dcc0441da3c984e26ae2e467b0ae554f (diff)
downloadale-5063804d44fe149ed39149848f92b5960f4f7164.zip
Add openscad and sca2d support (#4205)
Diffstat (limited to 'ale_linters')
-rw-r--r--ale_linters/openscad/sca2d.vim24
1 files changed, 24 insertions, 0 deletions
diff --git a/ale_linters/openscad/sca2d.vim b/ale_linters/openscad/sca2d.vim
new file mode 100644
index 00000000..60804a13
--- /dev/null
+++ b/ale_linters/openscad/sca2d.vim
@@ -0,0 +1,24 @@
+" Description: SCA2D linter for OpenSCAD files
+
+call ale#Set('openscad_sca2d_executable', 'sca2d')
+call ale#Set('openscad_sca2d_options', '')
+
+function! ale_linters#openscad#sca2d#GetExecutable(buffer) abort
+ return ale#Var(a:buffer, 'openscad_sca2d_executable')
+endfunction
+
+function! ale_linters#openscad#sca2d#GetCommand(buffer) abort
+ let l:executable = ale_linters#openscad#sca2d#GetExecutable(a:buffer)
+ let l:options = ale#Var(a:buffer, 'openscad_sca2d_options')
+
+ return ale#Escape(l:executable) . ale#Pad(l:options) . ' %s'
+endfunction
+
+call ale#linter#Define('openscad', {
+\ 'name': 'SCA2D',
+\ 'aliases': ['sca2d'],
+\ 'executable': function('ale_linters#openscad#sca2d#GetExecutable'),
+\ 'command': function('ale_linters#openscad#sca2d#GetCommand'),
+\ 'callback': 'ale#handlers#openscad#SCA2D_callback',
+\ 'lint_file': 1,
+\ })