Commit e181697
authored
housekeeping: tighten linting, testing, and verification standards (#47)
* update file permissions to 0o644 in test case for consistency
* refactor: simplify and standardize mutex usage, improve error messages, and enhance code consistency
* refactor: improve code comments, rename function return values for clarity, and standardize formatting
* add comment explaining purpose of `removeIPs` function
* add `test-short` target to Makefile for running quick tests without race detection
* increase coverage target to 80% and disable informational comments in codecov config
* document `test-short` target, verification process, and acceptance criteria in CLAUDE.md
* update CI workflows: enable caching, enforce 80% coverage, and standardize job configuration
* remove unnecessary package comment in `add.go`
* update `.golangci.yml`: enable additional linters, configure settings, and improve exclusions
* update `.golangci.yml`: adjust complexity thresholds, add `argument-limit` linter, and refine exclusions
* refactor `fuzz_test.go`: extract `validateParsedHostLine` helper, replace inline validation logic, and reuse `testBaseHosts` constant for clarity and consistency
* update CLAUDE.md: document enhanced verification steps, updated complexity thresholds, and new testing rules
* update GNUmakefile: add `coverage-check` target, enforce 80% coverage, refine `verify` and `verify-full` definitions
* refactor `property_test.go`: replace manual loops with `slices.Contains`, extract `validateParsedLines` helper, and reuse `testHostsLocalhost` constant for clarity and consistency
* refactor `root_test.go`: extract `setupTestHosts` and `captureOutput` helpers, reuse constants for clarity, and replace repetitive setup logic for improved consistency
* refactor `txeh.go`: replace `"windows"` string literals with `osWindows` constant for clarity and consistency
* refactor `txeh_test.go`: replace manual loops with `slices.Contains`, extract `createTempHostsFile` helper, reuse constants for clarity, and improve test consistency1 parent 7e2837d commit e181697
File tree
13 files changed
+582
-493
lines changed- .github/workflows
- txeh/cmd
13 files changed
+582
-493
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| 13 | + | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | | - | |
| 25 | + | |
23 | 26 | | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
| 30 | + | |
26 | 31 | | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
| 42 | + | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
38 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
39 | 57 | | |
40 | 58 | | |
41 | 59 | | |
| |||
44 | 62 | | |
45 | 63 | | |
46 | 64 | | |
| 65 | + | |
47 | 66 | | |
| 67 | + | |
| 68 | + | |
48 | 69 | | |
49 | 70 | | |
50 | 71 | | |
51 | 72 | | |
52 | 73 | | |
| 74 | + | |
53 | 75 | | |
54 | 76 | | |
55 | 77 | | |
| |||
58 | 80 | | |
59 | 81 | | |
60 | 82 | | |
| 83 | + | |
61 | 84 | | |
| 85 | + | |
| 86 | + | |
62 | 87 | | |
63 | 88 | | |
64 | 89 | | |
65 | 90 | | |
66 | 91 | | |
| 92 | + | |
67 | 93 | | |
68 | 94 | | |
69 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
41 | 53 | | |
42 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
43 | 58 | | |
44 | | - | |
| 59 | + | |
45 | 60 | | |
46 | 61 | | |
47 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
48 | 68 | | |
49 | 69 | | |
50 | 70 | | |
| |||
53 | 73 | | |
54 | 74 | | |
55 | 75 | | |
56 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
57 | 82 | | |
58 | 83 | | |
59 | 84 | | |
60 | 85 | | |
61 | 86 | | |
| 87 | + | |
| 88 | + | |
62 | 89 | | |
63 | 90 | | |
64 | 91 | | |
| |||
69 | 96 | | |
70 | 97 | | |
71 | 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 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
72 | 177 | | |
| 178 | + | |
73 | 179 | | |
74 | 180 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | 181 | | |
85 | 182 | | |
86 | 183 | | |
87 | 184 | | |
88 | 185 | | |
| 186 | + | |
89 | 187 | | |
90 | 188 | | |
91 | 189 | | |
| |||
96 | 194 | | |
97 | 195 | | |
98 | 196 | | |
99 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
100 | 200 | | |
101 | 201 | | |
102 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
71 | | - | |
72 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
73 | 77 | | |
74 | 78 | | |
75 | 79 | | |
| |||
93 | 97 | | |
94 | 98 | | |
95 | 99 | | |
96 | | - | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 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 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
100 | 136 | | |
101 | 137 | | |
102 | 138 | | |
| |||
148 | 184 | | |
149 | 185 | | |
150 | 186 | | |
151 | | - | |
| 187 | + | |
152 | 188 | | |
153 | 189 | | |
154 | | - | |
| 190 | + | |
155 | 191 | | |
156 | 192 | | |
157 | 193 | | |
| |||
0 commit comments