Commit: patch 9.1.1517: filetype: autopkgtest files are not recognized

3 views
Skip to first unread message

Christian Brabandt

unread,
Jul 6, 2025, 12:00:16 PM7/6/25
to vim...@googlegroups.com
patch 9.1.1517: filetype: autopkgtest files are not recognized

Commit: https://github.com/vim/vim/commit/5bcc492649f2d810577dd8dc4e1fb92f548847eb
Author: James McCoy <jame...@jamessan.com>
Date: Sun Jul 6 17:55:01 2025 +0200

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: #17679

Signed-off-by: James McCoy <jame...@jamessan.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 55bb45162..00196f775 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -690,11 +690,16 @@ au BufNewFile,BufRead *.dfy setf dafny
" Dart
au BufRead,BufNewfile *.dart,*.drt setf dart

+" Debian autopkgtest
+au BufNewFile,BufRead */debian/tests/control setf autopkgtest
+
" Debian Control
au BufNewFile,BufRead */{debian,DEBIAN}/control setf debcontrol
au BufNewFile,BufRead control
\ if getline(1) =~ '^Source:\|^Package:'
\| setf debcontrol
+ \| elseif getline(1) =~ '^Tests:\|^Test-Command:'
+ \| setf autopkgtest
\| endif

" Debian Copyright
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 286132b83..91fdc49f8 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -125,6 +125,7 @@ def s:GetFilenameChecks(): dict<list<string>>
autohotkey: ['file.ahk'],
autoit: ['file.au3'],
automake: ['GNUmakefile.am', 'makefile.am', 'Makefile.am'],
+ autopkgtest: ['/debian/tests/control', 'any/debian/tests/control'],
ave: ['file.ave'],
awk: ['file.awk', 'file.gawk'],
b: ['file.mch', 'file.ref', 'file.imp'],
diff --git a/src/version.c b/src/version.c
index 6b9d93450..6bd3f67ee 100644
--- a/src/version.c
+++ b/src/version.c
@@ -719,6 +719,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1517,
/**/
1516,
/**/
Reply all
Reply to author
Forward
0 new messages