Add support for various debian source files (debian/{tests/control,control,copyright,watch,upstream/metadata}) (#5107)

* Add debian-lsp support for autopkgtest files

Add Language Server Protocol support for debian/tests/control files
using debian-lsp (https://github.com/jelmer/debian-lsp).

Vim detects these files as filetype 'autopkgtest' by default.

* Add debian-lsp support for debcontrol files

Add Language Server Protocol support for debian/control files using
debian-lsp (https://github.com/jelmer/debian-lsp).

debian-lsp provides diagnostics, completions, and code actions for
Debian package control files.

* Add debian-lsp support for debcopyright files

Add Language Server Protocol support for debian/copyright files using
debian-lsp (https://github.com/jelmer/debian-lsp).

* Add debian-lsp support for debchangelog files

Add Language Server Protocol support for debian/changelog files using
debian-lsp (https://github.com/jelmer/debian-lsp).

* Add debian-lsp support for debsources files

Add Language Server Protocol support for debian/source/format files
using debian-lsp (https://github.com/jelmer/debian-lsp).

* Add debian-lsp support for debupstream files

Add Language Server Protocol support for debian/upstream/metadata
files using debian-lsp (https://github.com/jelmer/debian-lsp).

Note: Vim does not detect debian/upstream/metadata files by default.
Users need to add filetype detection to their vimrc:

  autocmd BufNewFile,BufRead */debian/upstream/metadata setfiletype debupstream

* Add debian-lsp support for debwatch files

Add Language Server Protocol support for debian/watch files using
debian-lsp (https://github.com/jelmer/debian-lsp).

Note: Vim does not detect debian/watch files by default. Users need to
add filetype detection to their vimrc:

  autocmd BufNewFile,BufRead */debian/watch setfiletype debwatch

* Add debian-lsp to supported tools documentation

Update supported-tools.md, ale-supported-languages-and-tools.txt,
and ale.txt table of contents to include the new Debian filetype
linters (autopkgtest, debchangelog, debcontrol, debcopyright,
debsources, debupstream, debwatch).
This commit is contained in:
Jelmer Vernooij
2026-06-21 11:09:16 +09:00
committed by GitHub
parent 178fe11356
commit 44ff0049a7
31 changed files with 689 additions and 0 deletions
@@ -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')
@@ -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')
@@ -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')
@@ -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')
@@ -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')
@@ -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')
@@ -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')