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
+31-25Lines changed: 31 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,33 +16,33 @@
16
16
17
17
<hr/>
18
18
19
-
##CODEOWNERS COMPARISON
19
+
# CODEOWNERS COMPARISON
20
20
21
-
**Codefather** can serve as a drop-in replacement for GitHub’s CODEOWNERS—or play alongside it like a trusted consigliere.
21
+
GitHub’s [CODEOWNERS](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) auto-assigns reviewers. But it can’t enforce real rules.
22
22
23
-
GitHub’s [CODEOWNERS](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) lets you define file owners in your codebase and automatically assign them as reviewers. No pull request can be merged until an appropriate codeowner has approved it.
23
+
**Codefather** gives you absolute control over your repository and can either replace or supercharge CODEOWNERS, like a trusted *consigliere*.
24
24
25
-
**Codefather** offers more flexibility in assigning codeowners: support for various roles (teams, leads, developers), complex file-match rules, local execution, commit protection, and more. It can prevent unauthorized changes, warn developers, list prohibited files with error levels and contact points, block sensitive merges via GitHub Actions, and auto-assign reviewers when needed.
25
+
It blocks unauthorized changes before they waste review time, empowers leads without flooding them with every PR, lets you choose between hard blocking or advisory enforcement, and provides actionable feedback by listing sensitive files touched and who to contact.
26
26
27
-
**Codefather** is designed to offer a delightful developer experience—a single config file for both CLI and GitHub Action usage, efficient commands to protect your codebase, automatic translation of CODEOWNERS into Codefather config, and over 100 personalized reactions to your commits.
27
+
Run it offline and online with a single config, enjoy advanced file-matching patterns, automatically translate your CODEOWNERS file, and get over 100 personalized reactions to your commits.
28
28
29
29
**Whether you're enforcing strict governance or just want the Don watching over your commits, Codefather brings clarity, control, and charisma to your workflow.**
> The `CodefatherConfig` allows you to control which users can modify parts of your codebase, and to refine the behavior of `codefather`.
134
134
@@ -145,14 +145,14 @@ type CodefatherConfig {
145
145
/** If true, all the pull request committers will be checked against the authorized users. Only used in a GitHub Action context. Defaults to true. */
146
146
vouchForAllCommitters?:boolean;
147
147
};
148
-
/** Options to auto assign reviewers on Github*/
148
+
/** Options to auto assign reviewers on GitHub*/
149
149
codeReviews?: {
150
150
/** If true, goodfellas responsible for modified files will be assigned on relevant pull requests, except the committers. Defaults to true. */
151
151
autoAssignGoodfellas: boolean;
152
152
/** If true, caporegimes will be assigned on every pull request, except the committers. Defaults to false. */
153
153
autoAssignCaporegimes: boolean;
154
154
};
155
-
/** Group users into teams. Crew names and composition are flexible in CLI mode but should match your github teams if used in a Github Action */
155
+
/** Group users into teams. Crew names and composition are flexible in CLI mode but should match your GitHub teams if used in a GitHub Action */
156
156
crews?:Record<string, {name: string}[]>;
157
157
}
158
158
```
@@ -174,7 +174,9 @@ type CodefatherRule {
174
174
}
175
175
```
176
176
177
-
The names should match the GitHub usernames (e.g., `tomhagen`). In CLI mode, your name will be retrieved retrieved from your Git configuration. You can set it like this:
177
+
## Name format
178
+
179
+
The names should match the GitHub usernames (e.g., `tomhagen`). In CLI mode, your name will be retrieved from your Git configuration. You can set it like this:
178
180
179
181
```bash
180
182
git config --global user.username "DonCorleone"
@@ -183,12 +185,12 @@ The names should match the GitHub usernames (e.g., `tomhagen`). In CLI mode, you
183
185
You can verify the current value like this:
184
186
185
187
```bash
186
-
git config user.username #return DonCorleone
188
+
git config user.username #returns DonCorleone
187
189
```
188
190
189
-
In a Github Action, `codefather` will use Github's API, so you don't have to worry about the git config.
191
+
In a GitHub Action, `codefather` will use GitHub's API, so you don't have to worry about the git config.
190
192
191
-
## How to Write Rules
193
+
## How to write rules
192
194
193
195
- Match all files in a folder (recursively): `src/myfolder/`
194
196
- Match a specific file: `src/myfolder/file.ts`
@@ -200,11 +202,15 @@ In a Github Action, `codefather` will use Github's API, so you don't have to wor
200
202
201
203
ℹ️ *More examples are available in the test files. Codefather's matching patterns follow classic file matcher rules, like GitHub CODEOWNERS.*
202
204
205
+
## Pre-commit
206
+
207
+
If you have [HUSKY](https://typicode.github.io/husky/) installed, you can add the `npm run codefather` command in the `.husky/pre-commit` file.
208
+
203
209
<hr/>
204
210
205
211
# GITHUB ACTION
206
212
207
-
Add this code in your `.github/workflows/codefather.yml` (the file name is up to you). The `GITHUB_TOKEN` will be automatically injected by Github.
213
+
Add this code in your `.github/workflows/codefather.yml`file (the file name is up to you). The `GITHUB_TOKEN` will be automatically injected by GitHub.
208
214
209
215
```yml
210
216
name: Codefather Validation
@@ -264,11 +270,11 @@ We believe open source libraries should be both useful and entertaining. The Don
264
270
265
271
This being said, if you don't like the gangster movie atmosphere and still want to use `codefather`, you can absolutely opt-out by providing your own custom messages and hiding the Don's face in the terminal.
Show your support for **Codefather** by becoming a sponsor if you or your company uses it! Your name or company logo will be displayed in the `README` and on the website.
274
280
@@ -280,6 +286,6 @@ Premium support is also available. https://github.com/sponsors/DoneDeal0
0 commit comments