# SYNTAX TEST "Git Code Owners.sublime-syntax"
# <- text.git.codeowners comment.line.git punctuation.definition.comment.git

# This is a comment.
# Each line is a file pattern followed by one or more owners.
# <- comment.line.git punctuation.definition.comment.git
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git

# These owners will be the default owners for everything in
# the repo, unless a later match takes precedence.
*       @global-owner1 @global-owner2
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners constant.other.wildcard.asterisk.fnmatch.git
#^^^^^^^ - meta
#       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.owners.git.codeowners
#       ^^^^^^^^^^^^^^ meta.reference.username.git entity.name.reference.username.git
#       ^ punctuation.definition.reference.username.git
#                      ^^^^^^^^^^^^^^ meta.reference.username.git entity.name.reference.username.git
#                      ^ punctuation.definition.reference.username.git

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @js-owner and not the global
# owner(s) will be requested for a review.
*.js    @js-owner #This is an inline comment.
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners constant.other.wildcard.asterisk.fnmatch.git
#^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#^ punctuation.separator.path.fnmatch.git
#   ^^^^ - meta
#       ^^^^^^^^^ meta.owners.git.codeowners meta.reference.username.git entity.name.reference.username.git
#       ^ punctuation.definition.reference.username.git
#                ^ - comment - invalid - meta - entity
#                 ^ punctuation.definition.comment.git
#                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.git

# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
*.go docs@example.com
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners constant.other.wildcard.asterisk.fnmatch.git
#^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#^ punctuation.separator.path.fnmatch.git
#   ^ - meta
#    ^^^^^^^^^^^^^^^^ meta.owners.git.codeowners meta.reference.email.git entity.name.reference.email.git

# In this example, @doctocat owns any files in the build/logs
# directory at the root of the repository and any of its
# subdirectories.
/build/logs/ @doctocat
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#^^^^^^^^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#     ^ punctuation.separator.path.fnmatch.git
#          ^ punctuation.separator.path.fnmatch.git
#           ^ - meta
#            ^^^^^^^^^ meta.owners.git.codeowners meta.reference.username.git entity.name.reference.username.git
#            ^ punctuation.definition.reference.username.git

# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
docs/*  docs@example.com
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#^^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#   ^ punctuation.separator.path.fnmatch.git
#    ^ constant.other.wildcard.asterisk.fnmatch.git
#     ^^ - meta
#       ^^^^^^^^^^^^^^^^ meta.owners.git.codeowners meta.reference.email.git entity.name.reference.email.git

# In this example, @octocat owns any file in an apps directory
# anywhere in your repository.
apps/ @octocat
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#   ^ punctuation.separator.path.fnmatch.git
#    ^ - meta
#     ^^^^^^^^ meta.owners.git.codeowners meta.reference.username.git entity.name.reference.username.git
#     ^ punctuation.definition.reference.username.git

# In this example, @doctocat owns any file in the `/docs`
# directory in the root of your repository and any of its
# subdirectories.
/docs/ @doctocat
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#^^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#    ^ punctuation.separator.path.fnmatch.git
#     ^ - meta
#      ^^^^^^^^^ meta.owners.git.codeowners meta.reference.username.git entity.name.reference.username.git

# In this example, any change inside the `/scripts` directory
# will require approval from @doctocat or @octocat.
/scripts/ @doctocat @octocat
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#^^^^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#       ^ punctuation.separator.path.fnmatch.git
#        ^ - meta
#         ^^^^^^^^^ meta.owners.git.codeowners meta.reference.username.git entity.name.reference.username.git
#                  ^ - meta.reference - entity
#                   ^^^^^^^^ meta.owners.git.codeowners meta.reference.username.git entity.name.reference.username.git

# In this example, @octocat owns any file in a `/logs` directory such as
# `/build/logs`, `/scripts/logs`, and `/deeply/nested/logs`. Any changes
# in a `/logs` directory will require approval from @octocat.
**/logs @octocat
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners constant.other.wildcard.asterisk.fnmatch.git
#^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners constant.other.wildcard.asterisk.fnmatch.git
# ^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#  ^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#      ^ - meta
#       ^^^^^^^^ meta.owners.git.codeowners meta.reference.username.git entity.name.reference.username.git

# In this example, @octocat owns any file in the `/apps`
# directory in the root of your repository except for the `/apps/github`
# subdirectory, as its owners are left empty.
/apps/ @octocat
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#    ^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#     ^ - meta
#      ^^^^^^^^ meta.owners.git.codeowners meta.reference.username.git entity.name.reference.username.git
/apps/github # Hi there.
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#    ^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#     ^^^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#           ^ - comment - invalid - meta - entity
#            ^ punctuation.definition.comment.git
#            ^^^^^^^^^^^^ comment.line.git

# In this example, @octocat owns any file in the `/apps`
# directory in the root of your repository except for the `/apps/github`
# subdirectory, as this subdirectory has its own owner @doctocat.
/apps/ @octocat
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#    ^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#     ^ - meta
#      ^^^^^^^^ meta.owners.git.codeowners meta.reference.username.git entity.name.reference.username.git
/apps/github @doctocat#Hello.
# <- meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#    ^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners punctuation.separator.path.fnmatch.git
#     ^^^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
#           ^ - meta
#            ^^^^^^^^^ meta.owners.git.codeowners meta.reference.username.git entity.name.reference.username.git
#                     ^ punctuation.definition.comment.git
#                     ^^^^^^^^ comment.line.git

-docs
# <- invalid.illegal.operator.git.codeowners

!d[oc]s
# <- invalid.illegal.operator.git.codeowners
# ^^^^ - keyword.control

\#pattern
# <- invalid.illegal.operator.git.codeowners
#^ invalid.illegal.operator.git.codeowners
# ^^^^^^^ meta.path.pattern.git.codeowners entity.name.pattern.git.codeowners
