Skip to content

Commit c322469

Browse files
authored
Merge pull request #42 from chrisjwalk/dx/commitlint-34
dx: add commitlint with conventional commits
2 parents c29c293 + 51db23b commit c322469

5 files changed

Lines changed: 440 additions & 10 deletions

File tree

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm dlx commitlint --edit "$1"

AGENTS.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,52 @@
2222

2323
Both accounts are configured in the `gh` CLI on this machine.
2424

25-
## PR Workflow
25+
## Complete Workflow — follow every step in order
2626

27-
Always follow this pattern when pushing branches and creating PRs:
27+
**1. Create an issue first** (as `chrisjwalk`, the default account):
28+
29+
```bash
30+
gh issue create --title "..." --body "..."
31+
# note the issue number, e.g. #42
32+
```
33+
34+
**2. Create a branch** referencing the issue:
35+
36+
```bash
37+
git checkout -b feat/short-description-42
38+
```
39+
40+
**3. Implement, commit** (git is configured to commit as `chrisjwalk-bot`):
41+
42+
```bash
43+
git commit -m "feat: description (closes #42)
44+
45+
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>"
46+
```
47+
48+
**4. Push and open PR as `chrisjwalk-bot`**:
2849

2950
```bash
30-
# 1. Switch to bot before pushing
3151
gh auth switch --user chrisjwalk-bot
32-
git push origin <branch>
33-
gh pr create ...
52+
git push origin feat/short-description-42
53+
gh pr create --title "..." --body "Closes #42 ..."
54+
```
55+
56+
**5. Switch back to owner**:
3457

35-
# 2. Switch back to owner account afterwards
58+
```bash
3659
gh auth switch --user chrisjwalk
3760
```
3861

62+
> ⚠️ Never open a PR without a corresponding issue. Never push as `chrisjwalk-bot` without switching back to `chrisjwalk` afterwards.
63+
3964
## Git Commit Identity
4065

4166
Git is configured locally in this repo to commit as the bot:
4267

4368
- `user.name` = `chrisjwalk-bot`
4469
- `user.email` = `268224883+chrisjwalk-bot@users.noreply.github.com`
4570

46-
## Issue Workflow
47-
48-
Create issues as `chrisjwalk` (the default active account). Always create a GitHub issue before starting work on a feature or fix, and reference it in the branch name and PR.
49-
5071
# Coding Conventions
5172

5273
## Styling: Tailwind over CSS

commitlint.config.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/** @type {import('@commitlint/types').UserConfig} */
2+
module.exports = {
3+
extends: ['@commitlint/config-conventional'],
4+
rules: {
5+
'type-enum': [
6+
2,
7+
'always',
8+
[
9+
'feat',
10+
'fix',
11+
'docs',
12+
'style',
13+
'refactor',
14+
'test',
15+
'chore',
16+
'perf',
17+
'ci',
18+
'a11y',
19+
'dx',
20+
],
21+
],
22+
},
23+
};

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
"@angular/cli": "21.2.2",
9090
"@angular/compiler-cli": "21.2.4",
9191
"@angular/language-service": "21.2.4",
92+
"@commitlint/cli": "^20.4.4",
93+
"@commitlint/config-conventional": "^20.4.4",
9294
"@eslint/eslintrc": "3.3.5",
9395
"@eslint/js": "10.0.1",
9496
"@nx/angular": "22.5.4",

0 commit comments

Comments
 (0)