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
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,6 +57,17 @@ js_package_paths:
57
57
58
58
This defaults `**/`, which makes it look for `package.json` files across your application.
59
59
60
+
### Custom Ownership
61
+
To enable custom ownership, you can inject your own custom classes into `code_ownership`.
62
+
To do this, first create a class that adheres to the `CodeOwnership::Mapper` and/or `CodeOwnership::Validator` interface.
63
+
Then, in `config/code_ownership.yml`, you can require that file:
64
+
```yml
65
+
require:
66
+
- ./lib/my_extension.rb
67
+
```
68
+
69
+
Now, `bin/codeownership validate` will automatically include your new mapper and/or validator. See [`spec/lib/code_ownership/private/extension_loader_spec.rb](spec/lib/code_ownership/private/extension_loader_spec.rb) for an example of what this looks like.
70
+
60
71
## Usage: Reading CodeOwnership
61
72
### `for_file`
62
73
`CodeOwnership.for_file`, given a relative path to a file returns a `CodeTeams::Team` if there is a team that owns the file, `nil` otherwise.
0 commit comments