Commit 0739892
committed
chore(quality): automated quality improvement pass — security fixes, test coverage +~170 tests, quality scorecard
Security:
- system: replace curl|bash with download→SHA256→verify→exec for Homebrew installer (mirrors OMZ pattern)
- config/validate: add regex validation for macOS defaults domain/key (reject whitespace/metacharacters)
- dotfiles: add regex guard on git branch names to prevent refspec injection
- shell/state: tighten .zshrc and state.json write permissions 0644→0600
- macos: move dry-run output from os.Stderr to stdout
- updater: replace sh -c dynamic string in execBrewUpgrade with sequential exec.Command calls
- brew: route Install/InstallCask through brewInstallCmd to inherit HOMEBREW_NO_AUTO_UPDATE=1
Tests (+~170 new tests, all green):
- internal/system: 39% → 66% (+27pp)
- internal/macos: 51% → 84% (+33pp)
- internal/npm: 55% → 93% (+38pp)
- internal/shell: 55% → 74% (+19pp)
- internal/brew: 65% → 74% (+9pp)
- internal/sync: 28% → 55% (+27pp)
- internal/cli: 19% → 35% (+16pp)
- internal/installer: 40% → 44% (+4pp)
Quality toolchain:
- Add quality/scorecard.yaml with weighted scoring dimensions
- Add scripts/quality-score.sh (deterministic score from golangci-lint + gosec + gocyclo + coverage)
- Add make quality / quality-lint / quality-security / quality-diff targets
- Update .golangci.yml with gosec, gocyclo (threshold 15), staticcheck, ineffassign
- Baseline score: 5.4/10 → 6.8/101 parent 527ebe9 commit 0739892
27 files changed
Lines changed: 3741 additions & 25 deletions
File tree
- internal
- brew
- cli
- config
- dotfiles
- installer
- macos
- npm
- shell
- state
- sync
- system
- updater
- quality
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | 11 | | |
6 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
7 | 17 | | |
8 | 18 | | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
13 | 23 | | |
| 24 | + | |
| 25 | + | |
14 | 26 | | |
| 27 | + | |
| 28 | + | |
15 | 29 | | |
16 | 30 | | |
17 | 31 | | |
| |||
25 | 39 | | |
26 | 40 | | |
27 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
28 | 47 | | |
29 | 48 | | |
30 | 49 | | |
31 | 50 | | |
32 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
0 commit comments