Skip to content

Extended the syntax highlighting for CODEOWNERS

Denys Mishunov requested to merge 393949-se-codewoners-highlighting into master

What does this MR do and why?

The MR adds support for highlighting the following information in the CODEOWNERS files:

  • the optional approval (^ in front of the section's name), and
  • the number of required approvals ([n] following the section's name, where n is the number of required approvals)

As requested in !114868 (comment 1322204566)

Screenshots or screen recordings

Theme Result
Light Screenshot_2023-03-22_at_23.07.36
Dark Screenshot_2023-03-22_at_23.07.48
Solarized Light Screenshot_2023-03-22_at_23.08.02
Solarized Dark Screenshot_2023-03-22_at_23.08.18
Monokai Screenshot_2023-03-22_at_23.08.31
None Screenshot_2023-03-22_at_23.08.42

How to set up and validate locally

Either open an existing CODEOWNERS file and check the highlighting, or create a new one and try adding content. For simplicity and speed, you can paste the following snippet:

# When adding a group as a code owner, make sure to invite the group to the
# project here: https://gitlab.com/gitlab-org/gitlab/-/project_members
# As described in https://docs.gitlab.com/ee/user/project/code_owners.html

* @gitlab-org/maintainers/rails-backend @gitlab-org/maintainers/frontend @gitlab-org/maintainers/database @gl-quality/qe-maintainers @gl-quality/tooling-maintainers @gitlab-org/delivery @gitlab-org/maintainers/cicd-templates @nolith @jacobvosmaer-gitlab @gitlab-org/tw-leadership

^[Source code editing]
.solargraph.yml.example @igor.drozdov

^[Backend][2]
*.rb @gitlab-org/maintainers/rails-backend
*.rake @gitlab-org/maintainers/rails-backend

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #393949 (closed)

Merge request reports