README.md in code_ownership-1.33.1 vs README.md in code_ownership-1.34.1
- old
+ new
@@ -10,10 +10,22 @@
## Usage: Declaring Ownership
There are three ways to declare code ownership using this gem.
+### Directory-Based Ownership
+Directory based ownership allows for all files in that directory and all its sub-directories to be owned by one team. To define this, add a `.codeowner` file inside that directory with the name of the team as the contents of that file.
+```
+Team
+```
+
+### File-Annotation Based Ownership
+File annotations are a last resort if there is no clear home for your code. File annotations go at the top of your file, and look like this:
+```ruby
+# @team MyTeam
+```
+
### Package-Based Ownership
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:
```yml
enforce_dependency: true
enforce_privacy: true
@@ -35,14 +47,9 @@
```yml
name: My Team
owned_globs:
- app/services/stuff_belonging_to_my_team/**/**
- app/controllers/other_stuff_belonging_to_my_team/**/**
-```
-### File-Annotation Based Ownership
-File annotations are a last resort if there is no clear home for your code. File annotations go at the top of your file, and look like this:
-```ruby
-# @team MyTeam
```
### Javascript Package Ownership
Javascript package based ownership allows you to specify an ownership key in a `package.json`. To use this, configure your `package.json` like this: