You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,17 @@
1
1
# CodeOwnership
2
-
This gem helps engineering teams declare ownership of code.
3
2
4
-
Check out `lib/code_ownership.rb` to see the public API.
3
+
This gem helps engineering teams declare ownership of code. This gem works best in large, usually monolithic code bases where many teams work together.
5
4
6
-
Check out `code_ownership_spec.rb` to see examples of how code ownership is used.
5
+
Check out [`lib/code_ownership.rb`](https://github.com/rubyatscale/code_ownership/blob/main/lib/code_ownership.rb) to see the public API.
6
+
7
+
Check out [`code_ownership_spec.rb`](https://github.com/rubyatscale/code_ownership/blob/main/spec/lib/code_ownership_spec.rb) to see examples of how code ownership is used.
7
8
8
9
There is also a [companion VSCode Extension]([url](https://github.com/rubyatscale/code-ownership-vscode)) for this gem. Just search `Gusto.code-ownership-vscode` in the VSCode Extension Marketplace.
9
10
10
11
## Usage: Declaring Ownership
12
+
11
13
There are three ways to declare code ownership using this gem.
14
+
12
15
### Package-Based Ownership
13
16
Package based ownership integrates [`packwerk`](https://github.com/Shopify/packwerk) and has ownership defined per package. To define that all files within a package are owned by one team, configure your `package.yml` like this:
14
17
```yml
@@ -71,7 +74,9 @@ See `code_ownership_spec.rb` for an example.
71
74
A `CODEOWNERS` file defines who owns specific files or paths in a repository. When you run `bin/codeownership validate`, a `.github/CODEOWNERS` file will automatically be generated and updated.
72
75
73
76
## Proper Configuration & Validation
77
+
74
78
CodeOwnership comes with a validation function to ensure the following things are true:
79
+
75
80
1) Only one mechanism is defining file ownership. That is -- you can't have a file annotation on a file owned via package-based or glob-based ownership. This helps make ownership behavior more clear by avoiding concerns about precedence.
76
81
2) All teams referenced as an owner for any file or package is a valid team (i.e. it's in the list of `CodeTeams.all`).
77
82
3) All files have ownership. You can specify in `unowned_globs` to represent a TODO list of files to add ownership to.
0 commit comments