codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: Debian autopkgtest control files3" Maintainer: Debian Vim Maintainers4" Last Change: 2025 Jul 055" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/autopkgtest.vim6"7" Specification of the autopkgtest format is available at:8" https://www.debian.org/doc/debian-policy/autopkgtest.txt9 10" Standard syntax initialization11if exists('b:current_syntax')12 finish13endif14 15let s:cpo_save = &cpo16set cpo&vim17 18" Must call this first, because it will clear other settings19syn sync clear20syn sync match autopkgtestSync grouphere NONE '^$'21 22" Should match case except for the keys of each field23syn case match24 25syn iskeyword @,48-57,-26 27" #-Comments28syn match autopkgtestComment "#.*" contains=@Spell29 30syn match autopkgtestTests contained "[a-z0-9][a-z0-9+.-]\+\%(,\=\s*[a-z0-9][a-z0-9+.-]\+\)*,\="31syn match autopkgtestArbitrary contained "[^#]*"32syn keyword autopkgtestRestrictions contained33 \ allow-stderr34 \ breaks-testbe35 \ build-neede36 \ flaky37 \ hint-testsuite-trigger38 \ isolation-container39 \ isolation-machine40 \ needs-internet41 \ needs-reboot42 \ needs-root43 \ needs-sudo44 \ rw-build-tree45 \ skip-foreign-architecture46 \ skip-not-installable47 \ skippable48 \ superficial49syn keyword autopkgtestDeprecatedRestrictions contained needs-recommends50syn match autopkgtestFeatures contained 'test-name=[^, ]*\%([, ]*[^, #]\)*,\='51syn match autopkgtestDepends contained '\%(@builddeps@\|@recommends@\|@\)'52 53runtime! syntax/shared/debarchitectures.vim54 55syn keyword autopkgtestArchitecture contained any56exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureKernelAnyArch)57exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureAnyKernelArch)58exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureArchs)59 60syn case ignore61 62" Catch-all for the legal fields63syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Tests: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestTests,autopkgtestComment64syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Restrictions: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestRestrictions,autopkgtestDeprecatedRestrictions,autopkgtestComment65syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Features: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestFeatures,autopkgtestComment66syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Depends: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestDepends,autopkgtestComment67syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Classes: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestComment68syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Architecture: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestArchitecture,autopkgtestComment69 70" Fields for which we do strict syntax checking71syn region autopkgtestStrictField matchgroup=autopkgtestKey start="^Test-Command: *" end="$" end='#'me=s-1 contains=autopkgtestArbitrary,autopkgtestComment oneline72syn region autopkgtestStrictField matchgroup=autopkgtestKey start="^Tests-Directory: *" end="$" end='#'me=s-1 contains=autopkgtestArbitrary,autopkgtestComment oneline73 74syn match autopkgtestError '^\%(\%(Architecture\|Classes\|Depends\|Features\|Restrictions\|Test-Command\|Tests-Directory\|Tests\)\@![^ #]*:\)'75 76" Associate our matches and regions with pretty colours77hi def link autopkgtestKey Keyword78hi def link autopkgtestRestrictions Identifier79hi def link autopkgtestFeatures Keyword80hi def link autopkgtestDepends Identifier81hi def link autopkgtestArchitecture Identifier82hi def link autopkgtestStrictField Error83hi def link autopkgtestDeprecatedRestrictions Error84hi def link autopkgtestMultiField Normal85hi def link autopkgtestArbitrary Normal86hi def link autopkgtestTests Normal87hi def link autopkgtestComment Comment88hi def link autopkgtestError Error89 90let b:current_syntax = 'autopkgtest'91 92let &cpo = s:cpo_save93unlet s:cpo_save94 95" vim: ts=8 sw=296 