mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
vim-patch:9.1.1517: filetype: autopkgtest files are not recognized
Problem: filetype: autopkgtest files are not recognized
Solution: detect */debian/tests/control files as autopkgtest filetype
(James McCoy)
Autopkgtest is a Debian tool for testing installed versions of packages
when other, related packages are updated.
Reference:
- https://www.debian.org/doc/debian-policy/autopkgtest.txt
related: vim/vim#17679
5bcc492649
Co-authored-by: James McCoy <jamessan@jamessan.com>
This commit is contained in:
committed by
Christian Clason
parent
8d5452c46d
commit
3177841bdf
@ -1969,6 +1969,7 @@ local detect_xkb = starsetf('xkb')
|
|||||||
local pattern = {
|
local pattern = {
|
||||||
-- BEGIN PATTERN
|
-- BEGIN PATTERN
|
||||||
['/debian/'] = {
|
['/debian/'] = {
|
||||||
|
['/debian/tests/control$'] = 'autopkgtest',
|
||||||
['/debian/changelog$'] = 'debchangelog',
|
['/debian/changelog$'] = 'debchangelog',
|
||||||
['/debian/control$'] = 'debcontrol',
|
['/debian/control$'] = 'debcontrol',
|
||||||
['/debian/copyright$'] = 'debcopyright',
|
['/debian/copyright$'] = 'debcopyright',
|
||||||
|
@ -264,6 +264,8 @@ function M.control(_, bufnr)
|
|||||||
local line1 = getline(bufnr, 1)
|
local line1 = getline(bufnr, 1)
|
||||||
if line1 and findany(line1, { '^Source:', '^Package:' }) then
|
if line1 and findany(line1, { '^Source:', '^Package:' }) then
|
||||||
return 'debcontrol'
|
return 'debcontrol'
|
||||||
|
elseif line1 and findany(line1, { '^Tests:', '^Test%-Command:' }) then
|
||||||
|
return 'autopkgtest'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -126,6 +126,7 @@ func s:GetFilenameChecks() abort
|
|||||||
\ 'autohotkey': ['file.ahk'],
|
\ 'autohotkey': ['file.ahk'],
|
||||||
\ 'autoit': ['file.au3'],
|
\ 'autoit': ['file.au3'],
|
||||||
\ 'automake': ['GNUmakefile.am', 'makefile.am', 'Makefile.am'],
|
\ 'automake': ['GNUmakefile.am', 'makefile.am', 'Makefile.am'],
|
||||||
|
\ 'autopkgtest': ['/debian/tests/control', 'any/debian/tests/control'],
|
||||||
\ 'ave': ['file.ave'],
|
\ 'ave': ['file.ave'],
|
||||||
\ 'awk': ['file.awk', 'file.gawk'],
|
\ 'awk': ['file.awk', 'file.gawk'],
|
||||||
\ 'b': ['file.mch', 'file.ref', 'file.imp'],
|
\ 'b': ['file.mch', 'file.ref', 'file.imp'],
|
||||||
|
Reference in New Issue
Block a user