diff --git a/ale_linters/autopkgtest/debian_lsp.vim b/ale_linters/autopkgtest/debian_lsp.vim new file mode 100644 index 000000000..d544fd9ee --- /dev/null +++ b/ale_linters/autopkgtest/debian_lsp.vim @@ -0,0 +1,23 @@ +" Author: Jelmer Vernooij +" Description: Language server for Debian package files + +call ale#Set('autopkgtest_debian_lsp_executable', 'debian-lsp') + +function! ale_linters#autopkgtest#debian_lsp#GetProjectRoot(buffer) abort + " Find the debian directory + let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian') + + if !empty(l:debian_dir) + return fnamemodify(l:debian_dir, ':h:h') + endif + + return '' +endfunction + +call ale#linter#Define('autopkgtest', { +\ 'name': 'debian_lsp', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#Var(b, 'autopkgtest_debian_lsp_executable')}, +\ 'command': '%e', +\ 'project_root': function('ale_linters#autopkgtest#debian_lsp#GetProjectRoot'), +\}) diff --git a/ale_linters/debchangelog/debian_lsp.vim b/ale_linters/debchangelog/debian_lsp.vim new file mode 100644 index 000000000..8ccf26a9a --- /dev/null +++ b/ale_linters/debchangelog/debian_lsp.vim @@ -0,0 +1,23 @@ +" Author: Jelmer Vernooij +" Description: Language server for Debian package files + +call ale#Set('debchangelog_debian_lsp_executable', 'debian-lsp') + +function! ale_linters#debchangelog#debian_lsp#GetProjectRoot(buffer) abort + " Find the debian directory + let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian') + + if !empty(l:debian_dir) + return fnamemodify(l:debian_dir, ':h:h') + endif + + return '' +endfunction + +call ale#linter#Define('debchangelog', { +\ 'name': 'debian_lsp', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#Var(b, 'debchangelog_debian_lsp_executable')}, +\ 'command': '%e', +\ 'project_root': function('ale_linters#debchangelog#debian_lsp#GetProjectRoot'), +\}) diff --git a/ale_linters/debcontrol/debian_lsp.vim b/ale_linters/debcontrol/debian_lsp.vim new file mode 100644 index 000000000..0eb052a49 --- /dev/null +++ b/ale_linters/debcontrol/debian_lsp.vim @@ -0,0 +1,23 @@ +" Author: Jelmer Vernooij +" Description: Language server for Debian package files + +call ale#Set('debcontrol_debian_lsp_executable', 'debian-lsp') + +function! ale_linters#debcontrol#debian_lsp#GetProjectRoot(buffer) abort + " Find the debian directory + let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian') + + if !empty(l:debian_dir) + return fnamemodify(l:debian_dir, ':h:h') + endif + + return '' +endfunction + +call ale#linter#Define('debcontrol', { +\ 'name': 'debian_lsp', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#Var(b, 'debcontrol_debian_lsp_executable')}, +\ 'command': '%e', +\ 'project_root': function('ale_linters#debcontrol#debian_lsp#GetProjectRoot'), +\}) diff --git a/ale_linters/debcopyright/debian_lsp.vim b/ale_linters/debcopyright/debian_lsp.vim new file mode 100644 index 000000000..662366f03 --- /dev/null +++ b/ale_linters/debcopyright/debian_lsp.vim @@ -0,0 +1,23 @@ +" Author: Jelmer Vernooij +" Description: Language server for Debian package files + +call ale#Set('debcopyright_debian_lsp_executable', 'debian-lsp') + +function! ale_linters#debcopyright#debian_lsp#GetProjectRoot(buffer) abort + " Find the debian directory + let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian') + + if !empty(l:debian_dir) + return fnamemodify(l:debian_dir, ':h:h') + endif + + return '' +endfunction + +call ale#linter#Define('debcopyright', { +\ 'name': 'debian_lsp', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#Var(b, 'debcopyright_debian_lsp_executable')}, +\ 'command': '%e', +\ 'project_root': function('ale_linters#debcopyright#debian_lsp#GetProjectRoot'), +\}) diff --git a/ale_linters/debsources/debian_lsp.vim b/ale_linters/debsources/debian_lsp.vim new file mode 100644 index 000000000..bc3adfc22 --- /dev/null +++ b/ale_linters/debsources/debian_lsp.vim @@ -0,0 +1,23 @@ +" Author: Jelmer Vernooij +" Description: Language server for Debian package files + +call ale#Set('debsources_debian_lsp_executable', 'debian-lsp') + +function! ale_linters#debsources#debian_lsp#GetProjectRoot(buffer) abort + " Find the debian directory + let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian') + + if !empty(l:debian_dir) + return fnamemodify(l:debian_dir, ':h:h') + endif + + return '' +endfunction + +call ale#linter#Define('debsources', { +\ 'name': 'debian_lsp', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#Var(b, 'debsources_debian_lsp_executable')}, +\ 'command': '%e', +\ 'project_root': function('ale_linters#debsources#debian_lsp#GetProjectRoot'), +\}) diff --git a/ale_linters/debupstream/debian_lsp.vim b/ale_linters/debupstream/debian_lsp.vim new file mode 100644 index 000000000..c82e23b64 --- /dev/null +++ b/ale_linters/debupstream/debian_lsp.vim @@ -0,0 +1,23 @@ +" Author: Jelmer Vernooij +" Description: Language server for Debian package files + +call ale#Set('debupstream_debian_lsp_executable', 'debian-lsp') + +function! ale_linters#debupstream#debian_lsp#GetProjectRoot(buffer) abort + " Find the debian directory + let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian') + + if !empty(l:debian_dir) + return fnamemodify(l:debian_dir, ':h:h') + endif + + return '' +endfunction + +call ale#linter#Define('debupstream', { +\ 'name': 'debian_lsp', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#Var(b, 'debupstream_debian_lsp_executable')}, +\ 'command': '%e', +\ 'project_root': function('ale_linters#debupstream#debian_lsp#GetProjectRoot'), +\}) diff --git a/ale_linters/debwatch/debian_lsp.vim b/ale_linters/debwatch/debian_lsp.vim new file mode 100644 index 000000000..34ebeb271 --- /dev/null +++ b/ale_linters/debwatch/debian_lsp.vim @@ -0,0 +1,23 @@ +" Author: Jelmer Vernooij +" Description: Language server for Debian package files + +call ale#Set('debwatch_debian_lsp_executable', 'debian-lsp') + +function! ale_linters#debwatch#debian_lsp#GetProjectRoot(buffer) abort + " Find the debian directory + let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian') + + if !empty(l:debian_dir) + return fnamemodify(l:debian_dir, ':h:h') + endif + + return '' +endfunction + +call ale#linter#Define('debwatch', { +\ 'name': 'debian_lsp', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#Var(b, 'debwatch_debian_lsp_executable')}, +\ 'command': '%e', +\ 'project_root': function('ale_linters#debwatch#debian_lsp#GetProjectRoot'), +\}) diff --git a/doc/ale-autopkgtest.txt b/doc/ale-autopkgtest.txt new file mode 100644 index 000000000..9f32cfea8 --- /dev/null +++ b/doc/ale-autopkgtest.txt @@ -0,0 +1,43 @@ +=============================================================================== +ALE Autopkgtest Integration *ale-autopkgtest-options* + + +=============================================================================== +debian-lsp *ale-autopkgtest-debian-lsp* + +Website: https://github.com/jelmer/debian-lsp + +debian-lsp is a Language Server Protocol implementation for Debian packaging +files. It supports debian/control, debian/copyright, debian/changelog, +debian/watch, debian/tests/control, debian/upstream/metadata, and +debian/source/format files with features including diagnostics, completions, +and code actions. + + +Installation +------------------------------------------------------------------------------- + +debian-lsp can be installed via cargo: > + + cargo install debian-lsp +< +Or from Debian repositories (if available): > + + apt install debian-lsp +< + +------------------------------------------------------------------------------- +Options + *ale-options.autopkgtest_debian_lsp_executable* + *g:ale_autopkgtest_debian_lsp_executable* + *b:ale_autopkgtest_debian_lsp_executable* +autopkgtest_debian_lsp_executable +g:ale_autopkgtest_debian_lsp_executable + Type: |String| + Default: `'debian-lsp'` + + This variable can be set to change the path to debian-lsp. + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale-debchangelog.txt b/doc/ale-debchangelog.txt new file mode 100644 index 000000000..ae50643a1 --- /dev/null +++ b/doc/ale-debchangelog.txt @@ -0,0 +1,42 @@ +=============================================================================== +ALE Debian Changelog Integration *ale-debchangelog-options* + + +=============================================================================== +debian-lsp *ale-debchangelog-debian-lsp* + +Website: https://github.com/jelmer/debian-lsp + +debian-lsp is a Language Server Protocol implementation for Debian packaging +files. It supports debian/control, debian/copyright, debian/changelog, and +debian/source/format files with features including diagnostics, completions, +and code actions. + + +Installation +------------------------------------------------------------------------------- + +debian-lsp can be installed via cargo: > + + cargo install debian-lsp +< +Or from Debian repositories (if available): > + + apt install debian-lsp +< + +------------------------------------------------------------------------------- +Options + *ale-options.debchangelog_debian_lsp_executable* + *g:ale_debchangelog_debian_lsp_executable* + *b:ale_debchangelog_debian_lsp_executable* +debchangelog_debian_lsp_executable +g:ale_debchangelog_debian_lsp_executable + Type: |String| + Default: `'debian-lsp'` + + This variable can be set to change the path to debian-lsp. + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale-debcontrol.txt b/doc/ale-debcontrol.txt new file mode 100644 index 000000000..585ee688b --- /dev/null +++ b/doc/ale-debcontrol.txt @@ -0,0 +1,42 @@ +=============================================================================== +ALE Debian Control Integration *ale-debcontrol-options* + + +=============================================================================== +debian-lsp *ale-debcontrol-debian-lsp* + +Website: https://github.com/jelmer/debian-lsp + +debian-lsp is a Language Server Protocol implementation for Debian packaging +files. It supports debian/control, debian/copyright, debian/changelog, and +debian/source/format files with features including diagnostics, completions, +and code actions. + + +Installation +------------------------------------------------------------------------------- + +debian-lsp can be installed via cargo: > + + cargo install debian-lsp +< +Or from Debian repositories (if available): > + + apt install debian-lsp +< + +------------------------------------------------------------------------------- +Options + *ale-options.debcontrol_debian_lsp_executable* + *g:ale_debcontrol_debian_lsp_executable* + *b:ale_debcontrol_debian_lsp_executable* +debcontrol_debian_lsp_executable +g:ale_debcontrol_debian_lsp_executable + Type: |String| + Default: `'debian-lsp'` + + This variable can be set to change the path to debian-lsp. + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale-debcopyright.txt b/doc/ale-debcopyright.txt new file mode 100644 index 000000000..15c2a2a9b --- /dev/null +++ b/doc/ale-debcopyright.txt @@ -0,0 +1,42 @@ +=============================================================================== +ALE Debian Copyright Integration *ale-debcopyright-options* + + +=============================================================================== +debian-lsp *ale-debcopyright-debian-lsp* + +Website: https://github.com/jelmer/debian-lsp + +debian-lsp is a Language Server Protocol implementation for Debian packaging +files. It supports debian/control, debian/copyright, debian/changelog, and +debian/source/format files with features including diagnostics, completions, +and code actions. + + +Installation +------------------------------------------------------------------------------- + +debian-lsp can be installed via cargo: > + + cargo install debian-lsp +< +Or from Debian repositories (if available): > + + apt install debian-lsp +< + +------------------------------------------------------------------------------- +Options + *ale-options.debcopyright_debian_lsp_executable* + *g:ale_debcopyright_debian_lsp_executable* + *b:ale_debcopyright_debian_lsp_executable* +debcopyright_debian_lsp_executable +g:ale_debcopyright_debian_lsp_executable + Type: |String| + Default: `'debian-lsp'` + + This variable can be set to change the path to debian-lsp. + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale-debsources.txt b/doc/ale-debsources.txt new file mode 100644 index 000000000..2d2d5fe94 --- /dev/null +++ b/doc/ale-debsources.txt @@ -0,0 +1,42 @@ +=============================================================================== +ALE Debian Sources Integration *ale-debsources-options* + + +=============================================================================== +debian-lsp *ale-debsources-debian-lsp* + +Website: https://github.com/jelmer/debian-lsp + +debian-lsp is a Language Server Protocol implementation for Debian packaging +files. It supports debian/control, debian/copyright, debian/changelog, and +debian/source/format files with features including diagnostics, completions, +and code actions. + + +Installation +------------------------------------------------------------------------------- + +debian-lsp can be installed via cargo: > + + cargo install debian-lsp +< +Or from Debian repositories (if available): > + + apt install debian-lsp +< + +------------------------------------------------------------------------------- +Options + *ale-options.debsources_debian_lsp_executable* + *g:ale_debsources_debian_lsp_executable* + *b:ale_debsources_debian_lsp_executable* +debsources_debian_lsp_executable +g:ale_debsources_debian_lsp_executable + Type: |String| + Default: `'debian-lsp'` + + This variable can be set to change the path to debian-lsp. + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale-debupstream.txt b/doc/ale-debupstream.txt new file mode 100644 index 000000000..f21931280 --- /dev/null +++ b/doc/ale-debupstream.txt @@ -0,0 +1,52 @@ +=============================================================================== +ALE Debian Upstream Metadata Integration *ale-debupstream-options* + + +=============================================================================== +debian-lsp *ale-debupstream-debian-lsp* + +Website: https://github.com/jelmer/debian-lsp + +debian-lsp is a Language Server Protocol implementation for Debian packaging +files. It supports debian/control, debian/copyright, debian/changelog, +debian/watch, debian/tests/control, debian/upstream/metadata, and +debian/source/format files with features including diagnostics, completions, +and code actions. + + +Installation +------------------------------------------------------------------------------- + +debian-lsp can be installed via cargo: > + + cargo install debian-lsp +< +Or from Debian repositories (if available): > + + apt install debian-lsp +< + +Filetype Detection +------------------------------------------------------------------------------- + +Vim does not detect debian/upstream/metadata files by default. To enable +detection, add the following to your vimrc: > + + autocmd BufNewFile,BufRead */debian/upstream/metadata setfiletype debupstream +< + +------------------------------------------------------------------------------- +Options + *ale-options.debupstream_debian_lsp_executable* + *g:ale_debupstream_debian_lsp_executable* + *b:ale_debupstream_debian_lsp_executable* +debupstream_debian_lsp_executable +g:ale_debupstream_debian_lsp_executable + Type: |String| + Default: `'debian-lsp'` + + This variable can be set to change the path to debian-lsp. + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale-debwatch.txt b/doc/ale-debwatch.txt new file mode 100644 index 000000000..d2f609ee8 --- /dev/null +++ b/doc/ale-debwatch.txt @@ -0,0 +1,51 @@ +=============================================================================== +ALE Debian Watch Integration *ale-debwatch-options* + + +=============================================================================== +debian-lsp *ale-debwatch-debian-lsp* + +Website: https://github.com/jelmer/debian-lsp + +debian-lsp is a Language Server Protocol implementation for Debian packaging +files. It supports debian/control, debian/copyright, debian/changelog, +debian/watch, and debian/source/format files with features including +diagnostics, completions, and code actions. + + +Installation +------------------------------------------------------------------------------- + +debian-lsp can be installed via cargo: > + + cargo install debian-lsp +< +Or from Debian repositories (if available): > + + apt install debian-lsp +< + +Filetype Detection +------------------------------------------------------------------------------- + +Vim does not detect debian/watch files by default. To enable detection, add +the following to your vimrc: > + + autocmd BufNewFile,BufRead */debian/watch setfiletype debwatch +< + +------------------------------------------------------------------------------- +Options + *ale-options.debwatch_debian_lsp_executable* + *g:ale_debwatch_debian_lsp_executable* + *b:ale_debwatch_debian_lsp_executable* +debwatch_debian_lsp_executable +g:ale_debwatch_debian_lsp_executable + Type: |String| + Default: `'debian-lsp'` + + This variable can be set to change the path to debian-lsp. + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt index 90b470b93..1fb7c2ec1 100644 --- a/doc/ale-supported-languages-and-tools.txt +++ b/doc/ale-supported-languages-and-tools.txt @@ -41,6 +41,8 @@ Notes: * Astro * `eslint` * `prettier` +* Autopkgtest (filetype autopkgtest) + * `debian-lsp` * AVRA * `avra` * Awk @@ -163,6 +165,18 @@ Notes: * `dart-format`!! * `dartfmt`!! * `language_server` +* Debian Changelog (filetype debchangelog) + * `debian-lsp` +* Debian Control (filetype debcontrol) + * `debian-lsp` +* Debian Copyright (filetype debcopyright) + * `debian-lsp` +* Debian Sources (filetype debsources) + * `debian-lsp` +* Debian Upstream Metadata (filetype debupstream) + * `debian-lsp` +* Debian Watch (filetype debwatch) + * `debian-lsp` * desktop * `desktop-file-validate` * Dhall diff --git a/doc/ale.txt b/doc/ale.txt index 99d1d621f..13ca121af 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -3436,6 +3436,8 @@ documented in additional help files. astro...................................|ale-astro-options| eslint................................|ale-astro-eslint| prettier..............................|ale-astro-prettier| + autopkgtest.............................|ale-autopkgtest-options| + debian-lsp............................|ale-autopkgtest-debian-lsp| avra....................................|ale-avra-options| avra..................................|ale-avra-avra| awk.....................................|ale-awk-options| @@ -3530,6 +3532,18 @@ documented in additional help files. dart-analyze..........................|ale-dart-analyze| dart-format...........................|ale-dart-format| dartfmt...............................|ale-dart-dartfmt| + debian changelog........................|ale-debchangelog-options| + debian-lsp............................|ale-debchangelog-debian-lsp| + debian control..........................|ale-debcontrol-options| + debian-lsp............................|ale-debcontrol-debian-lsp| + debian copyright........................|ale-debcopyright-options| + debian-lsp............................|ale-debcopyright-debian-lsp| + debian sources..........................|ale-debsources-options| + debian-lsp............................|ale-debsources-debian-lsp| + debian upstream metadata................|ale-debupstream-options| + debian-lsp............................|ale-debupstream-debian-lsp| + debian watch............................|ale-debwatch-options| + debian-lsp............................|ale-debwatch-debian-lsp| desktop.................................|ale-desktop-options| desktop-file-validate.................|ale-desktop-desktop-file-validate| dhall...................................|ale-dhall-options| diff --git a/supported-tools.md b/supported-tools.md index 6007ced02..02767e25c 100644 --- a/supported-tools.md +++ b/supported-tools.md @@ -51,6 +51,8 @@ formatting. * Astro * [eslint](http://eslint.org/) * [prettier](https://github.com/prettier/prettier) +* Autopkgtest (filetype autopkgtest) + * [debian-lsp](https://github.com/jelmer/debian-lsp) :speech_balloon: * AVRA * [avra](https://github.com/Ro5bert/avra) * Awk @@ -173,6 +175,18 @@ formatting. * [dart-format](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt) * [dartfmt](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt) * [language_server](https://github.com/natebosch/dart_language_server) +* Debian Changelog (filetype debchangelog) + * [debian-lsp](https://github.com/jelmer/debian-lsp) :speech_balloon: +* Debian Control (filetype debcontrol) + * [debian-lsp](https://github.com/jelmer/debian-lsp) :speech_balloon: +* Debian Copyright (filetype debcopyright) + * [debian-lsp](https://github.com/jelmer/debian-lsp) :speech_balloon: +* Debian Sources (filetype debsources) + * [debian-lsp](https://github.com/jelmer/debian-lsp) :speech_balloon: +* Debian Upstream Metadata (filetype debupstream) + * [debian-lsp](https://github.com/jelmer/debian-lsp) :speech_balloon: +* Debian Watch (filetype debwatch) + * [debian-lsp](https://github.com/jelmer/debian-lsp) :speech_balloon: * desktop * [desktop-file-validate](https://www.freedesktop.org/wiki/Software/desktop-file-utils/) * Dhall diff --git a/test/linter/test_autopkgtest_debian_lsp.vader b/test/linter/test_autopkgtest_debian_lsp.vader new file mode 100644 index 000000000..259decd66 --- /dev/null +++ b/test/linter/test_autopkgtest_debian_lsp.vader @@ -0,0 +1,18 @@ +Before: + call ale#assert#SetUpLinterTest('autopkgtest', 'debian_lsp') + +After: + call ale#assert#TearDownLinterTest() + +Execute(should set correct defaults): + AssertLinter 'debian-lsp', ale#Escape('debian-lsp') + +Execute(should set correct LSP values): + call ale#test#SetFilename('../test-files/autopkgtest/debian/tests/control') + + AssertLSPLanguage 'autopkgtest' + AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/autopkgtest') + +Execute(should accept custom executable): + let b:ale_autopkgtest_debian_lsp_executable = '/custom/path/debian-lsp' + AssertLinter '/custom/path/debian-lsp', ale#Escape('/custom/path/debian-lsp') diff --git a/test/linter/test_debchangelog_debian_lsp.vader b/test/linter/test_debchangelog_debian_lsp.vader new file mode 100644 index 000000000..23896946e --- /dev/null +++ b/test/linter/test_debchangelog_debian_lsp.vader @@ -0,0 +1,18 @@ +Before: + call ale#assert#SetUpLinterTest('debchangelog', 'debian_lsp') + +After: + call ale#assert#TearDownLinterTest() + +Execute(should set correct defaults): + AssertLinter 'debian-lsp', ale#Escape('debian-lsp') + +Execute(should set correct LSP values): + call ale#test#SetFilename('../test-files/debchangelog/debian/changelog') + + AssertLSPLanguage 'debchangelog' + AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/debchangelog') + +Execute(should accept custom executable): + let b:ale_debchangelog_debian_lsp_executable = '/custom/path/debian-lsp' + AssertLinter '/custom/path/debian-lsp', ale#Escape('/custom/path/debian-lsp') diff --git a/test/linter/test_debcontrol_debian_lsp.vader b/test/linter/test_debcontrol_debian_lsp.vader new file mode 100644 index 000000000..5cedf5a87 --- /dev/null +++ b/test/linter/test_debcontrol_debian_lsp.vader @@ -0,0 +1,18 @@ +Before: + call ale#assert#SetUpLinterTest('debcontrol', 'debian_lsp') + +After: + call ale#assert#TearDownLinterTest() + +Execute(should set correct defaults): + AssertLinter 'debian-lsp', ale#Escape('debian-lsp') + +Execute(should set correct LSP values): + call ale#test#SetFilename('../test-files/debcontrol/debian/control') + + AssertLSPLanguage 'debcontrol' + AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/debcontrol') + +Execute(should accept custom executable): + let b:ale_debcontrol_debian_lsp_executable = '/custom/path/debian-lsp' + AssertLinter '/custom/path/debian-lsp', ale#Escape('/custom/path/debian-lsp') diff --git a/test/linter/test_debcopyright_debian_lsp.vader b/test/linter/test_debcopyright_debian_lsp.vader new file mode 100644 index 000000000..ae52c5821 --- /dev/null +++ b/test/linter/test_debcopyright_debian_lsp.vader @@ -0,0 +1,18 @@ +Before: + call ale#assert#SetUpLinterTest('debcopyright', 'debian_lsp') + +After: + call ale#assert#TearDownLinterTest() + +Execute(should set correct defaults): + AssertLinter 'debian-lsp', ale#Escape('debian-lsp') + +Execute(should set correct LSP values): + call ale#test#SetFilename('../test-files/debcopyright/debian/copyright') + + AssertLSPLanguage 'debcopyright' + AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/debcopyright') + +Execute(should accept custom executable): + let b:ale_debcopyright_debian_lsp_executable = '/custom/path/debian-lsp' + AssertLinter '/custom/path/debian-lsp', ale#Escape('/custom/path/debian-lsp') diff --git a/test/linter/test_debsources_debian_lsp.vader b/test/linter/test_debsources_debian_lsp.vader new file mode 100644 index 000000000..926cb3875 --- /dev/null +++ b/test/linter/test_debsources_debian_lsp.vader @@ -0,0 +1,18 @@ +Before: + call ale#assert#SetUpLinterTest('debsources', 'debian_lsp') + +After: + call ale#assert#TearDownLinterTest() + +Execute(should set correct defaults): + AssertLinter 'debian-lsp', ale#Escape('debian-lsp') + +Execute(should set correct LSP values): + call ale#test#SetFilename('../test-files/debsources/debian/source/format') + + AssertLSPLanguage 'debsources' + AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/debsources') + +Execute(should accept custom executable): + let b:ale_debsources_debian_lsp_executable = '/custom/path/debian-lsp' + AssertLinter '/custom/path/debian-lsp', ale#Escape('/custom/path/debian-lsp') diff --git a/test/linter/test_debupstream_debian_lsp.vader b/test/linter/test_debupstream_debian_lsp.vader new file mode 100644 index 000000000..5fe32b765 --- /dev/null +++ b/test/linter/test_debupstream_debian_lsp.vader @@ -0,0 +1,18 @@ +Before: + call ale#assert#SetUpLinterTest('debupstream', 'debian_lsp') + +After: + call ale#assert#TearDownLinterTest() + +Execute(should set correct defaults): + AssertLinter 'debian-lsp', ale#Escape('debian-lsp') + +Execute(should set correct LSP values): + call ale#test#SetFilename('../test-files/debupstream/debian/upstream/metadata') + + AssertLSPLanguage 'debupstream' + AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/debupstream') + +Execute(should accept custom executable): + let b:ale_debupstream_debian_lsp_executable = '/custom/path/debian-lsp' + AssertLinter '/custom/path/debian-lsp', ale#Escape('/custom/path/debian-lsp') diff --git a/test/linter/test_debwatch_debian_lsp.vader b/test/linter/test_debwatch_debian_lsp.vader new file mode 100644 index 000000000..f7223b6f0 --- /dev/null +++ b/test/linter/test_debwatch_debian_lsp.vader @@ -0,0 +1,18 @@ +Before: + call ale#assert#SetUpLinterTest('debwatch', 'debian_lsp') + +After: + call ale#assert#TearDownLinterTest() + +Execute(should set correct defaults): + AssertLinter 'debian-lsp', ale#Escape('debian-lsp') + +Execute(should set correct LSP values): + call ale#test#SetFilename('../test-files/debwatch/debian/watch') + + AssertLSPLanguage 'debwatch' + AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/debwatch') + +Execute(should accept custom executable): + let b:ale_debwatch_debian_lsp_executable = '/custom/path/debian-lsp' + AssertLinter '/custom/path/debian-lsp', ale#Escape('/custom/path/debian-lsp') diff --git a/test/test-files/autopkgtest/debian/tests/control b/test/test-files/autopkgtest/debian/tests/control new file mode 100644 index 000000000..d65aed438 --- /dev/null +++ b/test/test-files/autopkgtest/debian/tests/control @@ -0,0 +1,3 @@ +Tests: run-tests +Depends: @ +Restrictions: allow-stderr diff --git a/test/test-files/debchangelog/debian/changelog b/test/test-files/debchangelog/debian/changelog new file mode 100644 index 000000000..c47f06342 --- /dev/null +++ b/test/test-files/debchangelog/debian/changelog @@ -0,0 +1,5 @@ +example (1.0-1) unstable; urgency=medium + + * Initial release. + + -- Example Mon, 01 Jan 2024 00:00:00 +0000 diff --git a/test/test-files/debcontrol/debian/control b/test/test-files/debcontrol/debian/control new file mode 100644 index 000000000..492b34b99 --- /dev/null +++ b/test/test-files/debcontrol/debian/control @@ -0,0 +1,12 @@ +Source: example +Section: misc +Priority: optional +Maintainer: Example +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.6.0 + +Package: example +Architecture: all +Depends: ${misc:Depends} +Description: Example package + This is an example package. diff --git a/test/test-files/debcopyright/debian/copyright b/test/test-files/debcopyright/debian/copyright new file mode 100644 index 000000000..122d390db --- /dev/null +++ b/test/test-files/debcopyright/debian/copyright @@ -0,0 +1,19 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: example +Upstream-Contact: Example +Source: https://example.com/example + +Files: * +Copyright: 2024 Example +License: MIT + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. diff --git a/test/test-files/debsources/debian/source/format b/test/test-files/debsources/debian/source/format new file mode 100644 index 000000000..163aaf8d8 --- /dev/null +++ b/test/test-files/debsources/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/test/test-files/debupstream/debian/upstream/metadata b/test/test-files/debupstream/debian/upstream/metadata new file mode 100644 index 000000000..003836b16 --- /dev/null +++ b/test/test-files/debupstream/debian/upstream/metadata @@ -0,0 +1,4 @@ +Bug-Database: https://github.com/example/example/issues +Bug-Submit: https://github.com/example/example/issues/new +Repository: https://github.com/example/example.git +Repository-Browse: https://github.com/example/example diff --git a/test/test-files/debwatch/debian/watch b/test/test-files/debwatch/debian/watch new file mode 100644 index 000000000..05e178c6c --- /dev/null +++ b/test/test-files/debwatch/debian/watch @@ -0,0 +1,2 @@ +version=4 +https://example.com/releases/example-(.+)\.tar\.gz