Commit 16fe695
refactor: eliminate plan_credits duplication, _copilot_api wrapper, and test boilerplate (#43)
- Collapse plan_credits() from two identical case blocks (promo/standard)
into one case keyed by plan type with inline promo check — saves ~16 lines
- Inline gh_api --api-version 2026-03-10 at both call sites and delete the
_copilot_api() 2-line wrapper that only existed to fix that flag
- Source lib/github-common.sh in install-hooks.sh to reuse color vars
(RED/GREEN/YELLOW/NC) instead of redeclaring them; keep the [HOOKS]-labelled
print functions since they differ from the lib's [SUCCESS]/[WARNING]/[ERROR]
- Add _run_script() helper to test_script_validation.bats and replace all 59
single-line run bash -c invocations — removes the repeated
"export PATH='${MOCK_BIN}:${PATH}';" boilerplate from every test body
All 91 bats tests pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent e0a1165 commit 16fe695
3 files changed
Lines changed: 79 additions & 99 deletions
File tree
- reporting/github-copilot-report
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
104 | 87 | | |
105 | 88 | | |
106 | 89 | | |
| |||
206 | 189 | | |
207 | 190 | | |
208 | 191 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | 192 | | |
218 | 193 | | |
219 | 194 | | |
220 | 195 | | |
221 | 196 | | |
222 | 197 | | |
223 | 198 | | |
224 | | - | |
| 199 | + | |
225 | 200 | | |
226 | 201 | | |
227 | 202 | | |
| |||
323 | 298 | | |
324 | 299 | | |
325 | 300 | | |
326 | | - | |
327 | | - | |
| 301 | + | |
328 | 302 | | |
329 | 303 | | |
330 | 304 | | |
| |||
0 commit comments