Commit 3169ff7
feat: add ANSI color support for test runner and error messages
- Add colored output for test results (green=passed, red=failed, yellow=ignored)
- Add colored error messages with red error prefix and underlines
- Add automatic TTY detection to disable colors when output is piped
- Add global --no-color flag to disable all colored output
- Add --no-color flag specifically for test command
- Use termcolor crate for cross-platform color support
- Use atty crate for TTY detection
- Fix test script compatibility by ensuring proper output formatting
Colors are automatically disabled when:
- Output is piped or redirected to a file
- The --no-color flag is used
- Not running in a TTY environment
This makes error messages and test results much easier to read while
maintaining compatibility with scripts and CI environments.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent ee02951 commit 3169ff7
File tree
6 files changed
+263
-32
lines changed- src
- tests
6 files changed
+263
-32
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 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 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
48 | 129 | | |
49 | 130 | | |
50 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
80 | 88 | | |
81 | 89 | | |
82 | 90 | | |
| |||
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| 119 | + | |
111 | 120 | | |
112 | 121 | | |
113 | | - | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
120 | 129 | | |
121 | | - | |
| 130 | + | |
122 | 131 | | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
126 | 135 | | |
127 | | - | |
| 136 | + | |
128 | 137 | | |
129 | 138 | | |
130 | 139 | | |
| |||
143 | 152 | | |
144 | 153 | | |
145 | 154 | | |
146 | | - | |
| 155 | + | |
| 156 | + | |
147 | 157 | | |
148 | 158 | | |
149 | 159 | | |
150 | 160 | | |
151 | 161 | | |
152 | 162 | | |
153 | 163 | | |
154 | | - | |
| 164 | + | |
155 | 165 | | |
156 | 166 | | |
157 | 167 | | |
| |||
268 | 278 | | |
269 | 279 | | |
270 | 280 | | |
271 | | - | |
| 281 | + | |
272 | 282 | | |
273 | 283 | | |
274 | 284 | | |
275 | 285 | | |
276 | | - | |
| 286 | + | |
| 287 | + | |
277 | 288 | | |
278 | 289 | | |
279 | 290 | | |
| |||
351 | 362 | | |
352 | 363 | | |
353 | 364 | | |
354 | | - | |
| 365 | + | |
355 | 366 | | |
356 | 367 | | |
357 | 368 | | |
| |||
389 | 400 | | |
390 | 401 | | |
391 | 402 | | |
392 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
393 | 406 | | |
394 | 407 | | |
395 | 408 | | |
396 | 409 | | |
397 | 410 | | |
398 | 411 | | |
399 | 412 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
405 | 416 | | |
406 | 417 | | |
407 | 418 | | |
| |||
429 | 440 | | |
430 | 441 | | |
431 | 442 | | |
| 443 | + | |
432 | 444 | | |
433 | 445 | | |
434 | 446 | | |
| |||
0 commit comments