Skip to content

Commit a1d74dd

Browse files
authored
At a Getting Started guide to the README (#105)
I found it a bit confusing how to get started with this gem, so I've added a high level guide that should give some general direction.
1 parent bf62bd1 commit a1d74dd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@ Check out [`code_ownership_spec.rb`](https://github.com/rubyatscale/code_ownersh
88

99
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.
1010

11+
## Getting started
12+
13+
To get started there's a few things you should do.
14+
15+
1) Create a `config/code_ownership.yml` file and declare where your files live. Here's a sample to start with:
16+
```yml
17+
owned_globs:
18+
- '{app,components,config,frontend,lib,packs,spec}/**/*.{rb,rake,js,jsx,ts,tsx}'
19+
js_package_paths: []
20+
unowned_globs:
21+
- db/**/*
22+
- app/services/some_file1.rb
23+
- app/services/some_file2.rb
24+
- frontend/javascripts/**/__generated__/**/*
25+
```
26+
2) Declare some teams. Here's an example, that would live at `config/teams/operations.yml`:
27+
```yml
28+
name: Operations
29+
github:
30+
team: '@my-org/operations-team'
31+
```
32+
3) Declare ownership. You can do this at a directory level or at a file level. All of the files within the `owned_globs` you declared in step 1 will need to have an owner assigned (or be opted out via `unowned_globs`). See the next section for more detail.
33+
4) Run validations when you commit, and/or in CI. If you run validations in CI, ensure that if your `.github/CODEOWNERS` file gets changed, that gets pushed to the PR.
34+
1135
## Usage: Declaring Ownership
1236

1337
There are three ways to declare code ownership using this gem.

0 commit comments

Comments
 (0)