0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-30 11:23:56 -05:00
forgejo/docs/content/usage/code-owners.en-us.md
John Olheiser bd4c7ce578
Docusaurus-ify (#26051)
This PR cleans up the docs in a way to make them simpler to ingest by
our [docs repo](https://gitea.com/gitea/gitea-docusaurus).

1. It includes all of the sed invocations our ingestion did, removing
the need to do it at build time.
2. It replaces the shortcode variable replacement method with
`@variable@` style, simply for easier sed invocations when required.
3. It removes unused files and moves the docs up a level as cleanup.

---------

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-07-26 04:53:13 +00:00

65 lines
1.3 KiB
Markdown

---
date: "2023-05-24T16:00:00+00:00"
title: "Code Owners"
slug: "code-owners"
sidebar_position: 30
toc: false
draft: false
aliases:
- /en-us/code-owners
menu:
sidebar:
parent: "usage"
name: "Code Owners"
sidebar_position: 30
identifier: "code-owners"
---
# Code Owners
Gitea maintains code owner files. It looks for it in the following locations in this order:
- `./CODEOWNERS`
- `./docs/CODEOWNERS`
- `./.gitea/CODEOWNERS`
And stops at the first found file.
File format: `<regexp rule> <@user or @org/team> [@user or @org/team]...`
Regexp specified in golang Regex format.
Regexp can start with `!` for negative rules - match all files except specified.
Example file:
```
.*\\.go @user1 @user2 # This is comment
# Comment too
# You can assigning code owning for users or teams
frontend/src/.*\\.js @org1/team1 @org1/team2 @user3
# You can use negative pattern
!frontend/src/.* @org1/team3 @user5
# You can use power of go regexp
docs/(aws|google|azure)/[^/]*\\.(md|txt) @user8 @org1/team4
!/assets/.*\\.(bin|exe|msi) @user9
```
### Escaping
You can escape characters `#`, ` ` (space) and `\` with `\`, like:
```
dir/with\#hashtag @user1
path\ with\ space @user2
path/with\\backslash @user3
```
Some character (`.+*?()|[]{}^$\`) should be escaped with `\\` inside regexp, like:
```
path/\\.with\\.dots
path/with\\+plus
```