File: autopkgtest.vim

package info (click to toggle)
vim 2%3A9.1.1882-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 92,504 kB
  • sloc: ansic: 432,444; cpp: 6,371; makefile: 4,596; sh: 2,387; java: 2,312; xml: 2,099; python: 1,559; perl: 1,419; awk: 730; lisp: 501; cs: 458; objc: 369; sed: 8; csh: 6
file content (95 lines) | stat: -rw-r--r-- 4,254 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
" Vim syntax file
" Language:    Debian autopkgtest control files
" Maintainer:  Debian Vim Maintainers
" Last Change: 2025 Jul 05
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/autopkgtest.vim
"
" Specification of the autopkgtest format is available at:
"   https://www.debian.org/doc/debian-policy/autopkgtest.txt

" Standard syntax initialization
if exists('b:current_syntax')
  finish
endif

let s:cpo_save = &cpo
set cpo&vim

" Must call this first, because it will clear other settings
syn sync clear
syn sync match autopkgtestSync grouphere NONE '^$'

" Should match case except for the keys of each field
syn case match

syn iskeyword @,48-57,-

" #-Comments
syn match autopkgtestComment "#.*" contains=@Spell

syn match autopkgtestTests contained "[a-z0-9][a-z0-9+.-]\+\%(,\=\s*[a-z0-9][a-z0-9+.-]\+\)*,\="
syn match autopkgtestArbitrary contained "[^#]*"
syn keyword autopkgtestRestrictions contained
      \ allow-stderr
      \ breaks-testbe
      \ build-neede
      \ flaky
      \ hint-testsuite-trigger
      \ isolation-container
      \ isolation-machine
      \ needs-internet
      \ needs-reboot
      \ needs-root
      \ needs-sudo
      \ rw-build-tree
      \ skip-foreign-architecture
      \ skip-not-installable
      \ skippable
      \ superficial
syn keyword autopkgtestDeprecatedRestrictions contained needs-recommends
syn match autopkgtestFeatures contained 'test-name=[^, ]*\%([, ]*[^, #]\)*,\='
syn match autopkgtestDepends contained '\%(@builddeps@\|@recommends@\|@\)'

runtime! syntax/shared/debarchitectures.vim

syn keyword autopkgtestArchitecture contained any
exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureKernelAnyArch)
exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureAnyKernelArch)
exe 'syn keyword autopkgtestArchitecture contained '. join(g:debArchitectureArchs)

syn case ignore

" Catch-all for the legal fields
syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Tests: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestTests,autopkgtestComment
syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Restrictions: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestRestrictions,autopkgtestDeprecatedRestrictions,autopkgtestComment
syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Features: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestFeatures,autopkgtestComment
syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Depends: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestDepends,autopkgtestComment
syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Classes: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestComment
syn region autopkgtestMultiField matchgroup=autopkgtestKey start="^Architecture: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=autopkgtestArchitecture,autopkgtestComment

" Fields for which we do strict syntax checking
syn region autopkgtestStrictField matchgroup=autopkgtestKey start="^Test-Command: *" end="$" end='#'me=s-1 contains=autopkgtestArbitrary,autopkgtestComment oneline
syn region autopkgtestStrictField matchgroup=autopkgtestKey start="^Tests-Directory: *" end="$" end='#'me=s-1 contains=autopkgtestArbitrary,autopkgtestComment oneline

syn match autopkgtestError '^\%(\%(Architecture\|Classes\|Depends\|Features\|Restrictions\|Test-Command\|Tests-Directory\|Tests\)\@![^ #]*:\)'

" Associate our matches and regions with pretty colours
hi def link autopkgtestKey           Keyword
hi def link autopkgtestRestrictions  Identifier
hi def link autopkgtestFeatures      Keyword
hi def link autopkgtestDepends       Identifier
hi def link autopkgtestArchitecture  Identifier
hi def link autopkgtestStrictField   Error
hi def link autopkgtestDeprecatedRestrictions Error
hi def link autopkgtestMultiField    Normal
hi def link autopkgtestArbitrary     Normal
hi def link autopkgtestTests         Normal
hi def link autopkgtestComment       Comment
hi def link autopkgtestError         Error

let b:current_syntax = 'autopkgtest'

let &cpo = s:cpo_save
unlet s:cpo_save

" vim: ts=8 sw=2