robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqvim-patch:1903020: runtime(autopkgtest): update syntax script (#39616)f39f6f72a7

master
4.2 KiB97 linesraw
1" Vim syntax file
2" Language:    Debian autopkgtest control files
3" Maintainer:  Debian Vim Maintainers
4" Last Change: 2025 Jul 05
5" 2026 May 05 by Vim project: fix typos
6" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/autopkgtest.vim
7"
8" Specification of the autopkgtest format is available at:
9"   https://www.debian.org/doc/debian-policy/autopkgtest.txt
10
11" Standard syntax initialization
12if exists('b:current_syntax')
13  finish
14endif
15
16let s:cpo_save = &cpo
17set cpo&vim
18
19" Must call this first, because it will clear other settings
20syn sync clear
21syn sync match autopkgtestSync grouphere NONE '^$'
22
23" Should match case except for the keys of each field
24syn case match
25
26syn iskeyword @,48-57,-
27
28" #-Comments
29syn match autopkgtestComment "#.*" contains=@Spell
30
31syn match autopkgtestTests contained "[a-z0-9][a-z0-9+.-]\+\%(,\=\s*[a-z0-9][a-z0-9+.-]\+\)*,\="
32syn match autopkgtestArbitrary contained "[^#]*"
33syn keyword autopkgtestRestrictions contained
34      \ allow-stderr
35      \ breaks-testbed
36      \ build-needed
37      \ flaky
38      \ hint-testsuite-triggers
39      \ isolation-container
40      \ isolation-machine
41      \ needs-internet
42      \ needs-reboot
43      \ needs-root
44      \ needs-sudo
45      \ rw-build-tree
46      \ skip-foreign-architecture
47      \ skippable
48      \ superficial
49syn keyword autopkgtestDeprecatedRestrictions contained
50      \ needs-recommends
51      \ skip-not-installable
52syn match autopkgtestFeatures contained 'test-name=[^, ]*\%([, ]*[^, #]\)*,\='
53syn match autopkgtestDepends contained '\%(@builddeps@\|@recommends@\|@\)'
54
55runtime! syntax/shared/debarchitectures.vim
56
57syn keyword autopkgtestArchitecture contained any
58exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureKernelAnyArch)
59exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureAnyKernelArch)
60exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureArchs)
61
62syn case ignore
63
64" Catch-all for the legal fields
65syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Tests: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestTests,autopkgtestComment
66syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Restrictions: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestRestrictions,autopkgtestDeprecatedRestrictions,autopkgtestComment
67syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Features: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestFeatures,autopkgtestComment
68syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Depends: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestDepends,autopkgtestComment
69syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Classes: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestComment
70syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Architecture: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestArchitecture,autopkgtestComment
71
72" Fields for which we do strict syntax checking
73syn region autopkgtestStrictField matchgroup=autopkgtestKey start="^Test-Command: *" end="$" end='#'me=s-1 contains=autopkgtestArbitrary,autopkgtestComment oneline
74syn region autopkgtestStrictField matchgroup=autopkgtestKey start="^Tests-Directory: *" end="$" end='#'me=s-1 contains=autopkgtestArbitrary,autopkgtestComment oneline
75
76syn match autopkgtestError '^\%(\%(Architecture\|Classes\|Depends\|Features\|Restrictions\|Test-Command\|Tests-Directory\|Tests\)\@![^ #]*:\)'
77
78" Associate our matches and regions with pretty colours
79hi def link autopkgtestKey           Keyword
80hi def link autopkgtestRestrictions  Identifier
81hi def link autopkgtestFeatures      Keyword
82hi def link autopkgtestDepends       Identifier
83hi def link autopkgtestArchitecture  Identifier
84hi def link autopkgtestStrictField   Error
85hi def link autopkgtestDeprecatedRestrictions Error
86hi def link autopkgtestMultiField    Normal
87hi def link autopkgtestArbitrary     Normal
88hi def link autopkgtestTests         Normal
89hi def link autopkgtestComment       Comment
90hi def link autopkgtestError         Error
91
92let b:current_syntax = 'autopkgtest'
93
94let &cpo = s:cpo_save
95unlet s:cpo_save
96
97" vim: ts=8 sw=2