patch 9.1.1764: filetype: CODEOWNERS file not recognized

Problem:  filetype: CODEOWNERS file not recognized
Solution: Detect CODEOWNERS file as codeowners filetype, include a
          syntax and filetype plugin (Jon Parise).

CODEOWNERS files define code ownership rules for GitHub-hosted (and
other) repositories. The syntax is similar to 'gitignore' files but
differs in enough ways to warrant its own filetype.

References:
- https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

closes: #18299

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Jon Parise
2025-09-15 19:35:47 +00:00
committed by Christian Brabandt
parent a946ccf5ff
commit 817e4d3ee6
8 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,23 @@
" Vim syntax file
" Language: codeowners
" Maintainer: Jon Parise <jon@indelible.org>
" Last Change: 2025 Sep 14
if exists('b:current_syntax')
finish
endif
" Comments
syn match codeownersComment /#.*$/ contains=codeownersTodo,@Spell
syn keyword codeownersTodo TODO FIXME XXX contained
" Patterns
syn match codeownersPattern /^#\@![^#]*/ contains=codeownersGlob
syn match codeownersGlob /^\S\+/ contained nextgroup=codeownersOwner skipwhite
syn match codeownersOwner /\S\+/ contained nextgroup=codeownersOwner skipwhite
hi def link codeownersComment Comment
hi def link codeownersOwner Identifier
hi def link codeownersTodo Todo
let b:current_syntax = 'codeowners'

View File

@ -0,0 +1,20 @@
>#+0#0000e05#ffffff0| |T|h|i|s| |i|s| |a| |c|o|m@1|e|n|t|.| +0#0000000&@54
|#+0#0000e05&| |E|a|c|h| |l|i|n|e| |i|s| |a| |f|i|l|e| |p|a|t@1|e|r|n| |f|o|l@1|o|w|e|d| |b|y| |o|n|e| |o|r| |m|o|r|e| |o|w|n|e|r|s|.| +0#0000000&@13
@75
|*| @6|@+0#00e0e07&|g|l|o|b|a|l|-|o|w|n|e|r|1| +0#0000000&|@+0#00e0e07&|g|l|o|b|a|l|-|o|w|n|e|r|2| +0#0000000&@37
|*|.|j|s| @3|@+0#00e0e07&|j|s|-|o|w|n|e|r| +0#0000000&|#+0#0000e05&|T|h|i|s| |i|s| |a|n| |i|n|l|i|n|e| |c|o|m@1|e|n|t|.| +0#0000000&@29
|*|.|g|o| @3|d+0#00e0e07&|o|c|s|@|e|x|a|m|p|l|e|.|c|o|m| +0#0000000&@50
|*|.|t|x|t| @2|@+0#00e0e07&|o|c|t|o|-|o|r|g|/|o|c|t|o|c|a|t|s| +0#0000000&@48
|/|a|/|b|/| @2|@+0#00e0e07&|d|o|c|t|o|c|a|t| +0#0000000&@57
|d|o|c|s|/|*| @1|d+0#00e0e07&|o|c|s|@|e|x|a|m|p|l|e|.|c|o|m| +0#0000000&|@+0#00e0e07&|o|t|h|e|r| +0#0000000&@43
|*@1|/|l|o|g|s| |@+0#00e0e07&|o|c|t|o|c|a|t| +0#0000000&@58
@75
|#+0#0000e05&| |v|i|m|:| |s|e|t| |f|t|=|c|o|d|e|o|w|n|e|r|s|:| +0#0000000&@49
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|1|,|1| @10|A|l@1|

View File

@ -0,0 +1,12 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.
* @global-owner1 @global-owner2
*.js @js-owner #This is an inline comment.
*.go docs@example.com
*.txt @octo-org/octocats
/a/b/ @doctocat
docs/* docs@example.com @other
**/logs @octocat
# vim: set ft=codeowners: