Repository navigation
Commit 0ded835
authored
Merge pull request #316: fix(powershell): bind positional scan paths to -Paths
The wrapper's own documented invocation scanned the wrong tree. `--` ends PowerShell's parameter parsing, what follows binds positionally, and $Root was declared first — so `own-check.ps1 -Format msbuild -- src\MyApp` made src\MyApp the checkout root and let the scan fall through to ".". Bare positional paths did the same; only an explicit -Paths arrived.
The failure was silent, which is what made it worth a slice of its own: ask for directory A, get directory B analysed, and a clean B hands back a green result with no error at all. Same shape as the lie A1 and A4 removed — "did not look" wearing the face of "looked and found nothing" — except the tool did look, just not where it was sent.
Fixed by declaring the contract rather than inheriting it from declaration order: PositionalBinding = $false, and $Paths claims Position 0 explicitly. Reordering the param block would have worked today and left the meaning resting on the same implicit machinery that had already produced this twice.
CI gains the half that actually catches a wrong-tree scan: from a CLEAN working directory, ask for a target holding a guaranteed OWN001 and require the finding to return while the cwd's own file never appears. The `--` and -Paths forms must produce identical output, and two positional paths must both arrive — [string[]] is the declared type, and a one-element proof does not establish it.
Known boundary, documented rather than papered over: under `pwsh -File` the `--` token is intercepted by the host before parameter binding. That is PowerShell's own -File handling; the supported forms there are a bare positional path or an explicit -Paths.2 files changed
Lines changed: 76 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2112 | 2112 | | |
2113 | 2113 | | |
2114 | 2114 | | |
2115 | | - | |
2116 | | - | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
2117 | 2119 | | |
2118 | 2120 | | |
2119 | 2121 | | |
| |||
2157 | 2159 | | |
2158 | 2160 | | |
2159 | 2161 | | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
2160 | 2177 | | |
2161 | 2178 | | |
2162 | 2179 | | |
| |||
2201 | 2218 | | |
2202 | 2219 | | |
2203 | 2220 | | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
2204 | 2266 | | |
2205 | 2267 | | |
2206 | 2268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
67 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
| |||
0 commit comments