autopkgtest.vim (4305B)
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 12 if exists('b:current_syntax') 13 finish 14 endif 15 16 let s:cpo_save = &cpo 17 set cpo&vim 18 19 " Must call this first, because it will clear other settings 20 syn sync clear 21 syn sync match autopkgtestSync grouphere NONE '^$' 22 23 " Should match case except for the keys of each field 24 syn case match 25 26 syn iskeyword @,48-57,- 27 28 " #-Comments 29 syn match autopkgtestComment "#.*" contains=@Spell 30 31 syn match autopkgtestTests contained "[a-z0-9][a-z0-9+.-]\+\%(,\=\s*[a-z0-9][a-z0-9+.-]\+\)*,\=" 32 syn match autopkgtestArbitrary contained "[^#]*" 33 syn 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 49 syn keyword autopkgtestDeprecatedRestrictions contained 50 \ needs-recommends 51 \ skip-not-installable 52 syn match autopkgtestFeatures contained 'test-name=[^, ]*\%([, ]*[^, #]\)*,\=' 53 syn match autopkgtestDepends contained '\%(@builddeps@\|@recommends@\|@\)' 54 55 runtime! syntax/shared/debarchitectures.vim 56 57 syn keyword autopkgtestArchitecture contained any 58 exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureKernelAnyArch) 59 exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureAnyKernelArch) 60 exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureArchs) 61 62 syn case ignore 63 64 " Catch-all for the legal fields 65 syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Tests: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestTests,autopkgtestComment 66 syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Restrictions: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestRestrictions,autopkgtestDeprecatedRestrictions,autopkgtestComment 67 syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Features: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestFeatures,autopkgtestComment 68 syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Depends: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestDepends,autopkgtestComment 69 syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Classes: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestComment 70 syn 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 73 syn region autopkgtestStrictField matchgroup=autopkgtestKey start="^Test-Command: *" end="$" end='#'me=s-1 contains=autopkgtestArbitrary,autopkgtestComment oneline 74 syn region autopkgtestStrictField matchgroup=autopkgtestKey start="^Tests-Directory: *" end="$" end='#'me=s-1 contains=autopkgtestArbitrary,autopkgtestComment oneline 75 76 syn match autopkgtestError '^\%(\%(Architecture\|Classes\|Depends\|Features\|Restrictions\|Test-Command\|Tests-Directory\|Tests\)\@![^ #]*:\)' 77 78 " Associate our matches and regions with pretty colours 79 hi def link autopkgtestKey Keyword 80 hi def link autopkgtestRestrictions Identifier 81 hi def link autopkgtestFeatures Keyword 82 hi def link autopkgtestDepends Identifier 83 hi def link autopkgtestArchitecture Identifier 84 hi def link autopkgtestStrictField Error 85 hi def link autopkgtestDeprecatedRestrictions Error 86 hi def link autopkgtestMultiField Normal 87 hi def link autopkgtestArbitrary Normal 88 hi def link autopkgtestTests Normal 89 hi def link autopkgtestComment Comment 90 hi def link autopkgtestError Error 91 92 let b:current_syntax = 'autopkgtest' 93 94 let &cpo = s:cpo_save 95 unlet s:cpo_save 96 97 " vim: ts=8 sw=2