code.gitea.io/gitea@v1.22.3/docs/content/usage/code-owners.en-us.md (about) 1 --- 2 date: "2023-05-24T16:00:00+00:00" 3 title: "Code Owners" 4 slug: "code-owners" 5 sidebar_position: 30 6 toc: false 7 draft: false 8 aliases: 9 - /en-us/code-owners 10 menu: 11 sidebar: 12 parent: "usage" 13 name: "Code Owners" 14 sidebar_position: 30 15 identifier: "code-owners" 16 --- 17 18 # Code Owners 19 20 Gitea maintains code owner files. It looks for it in the following locations in this order: 21 22 - `./CODEOWNERS` 23 - `./docs/CODEOWNERS` 24 - `./.gitea/CODEOWNERS` 25 26 And stops at the first found file. 27 28 File format: `<regexp rule> <@user or @org/team> [@user or @org/team]...` 29 30 Regexp specified in golang Regex format. 31 Regexp can start with `!` for negative rules - match all files except specified. 32 33 Example file: 34 35 ``` 36 .*\\.go @user1 @user2 # This is comment 37 38 # Comment too 39 # You can assigning code owning for users or teams 40 frontend/src/.*\\.js @org1/team1 @org1/team2 @user3 41 42 # You can use negative pattern 43 !frontend/src/.* @org1/team3 @user5 44 45 # You can use power of go regexp 46 docs/(aws|google|azure)/[^/]*\\.(md|txt) @user8 @org1/team4 47 !/assets/.*\\.(bin|exe|msi) @user9 48 ``` 49 50 ### Escaping 51 52 You can escape characters `#`, ` ` (space) and `\` with `\`, like: 53 54 ``` 55 dir/with\#hashtag @user1 56 path\ with\ space @user2 57 path/with\\backslash @user3 58 ``` 59 60 Some character (`.+*?()|[]{}^$\`) should be escaped with `\\` inside regexp, like: 61 62 ``` 63 path/\\.with\\.dots 64 path/with\\+plus 65 ```