specguard-ruby 0.3.20 → 0.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -2
- data/lib/specguard/rspec/cli.rb +22 -0
- data/lib/specguard/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9d4b951dc75ccc47535a3cf964876c26153eb72e6fcdfb2244e597b06b2c4981
|
|
4
|
+
data.tar.gz: 5ee16e5bde0603d89334e8be374ecf831442275f8bda5b7fb9d9514dec0ba597
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b33f7f1e895f5b18aca3ca8b218f7d31c8962e8b0eccfbf67401c79ffc75e4b7e6502f07fd416c32703726be9091eac2ff4428404314be400f97cce56966b4e6
|
|
7
|
+
data.tar.gz: c9eff95babda443781ad6b1147265c94660df1e1c34271169a4b7b18e0a4ac322c0b801dae059d0488d7a6180440bad7bef74852bad915dae30438c2c978b59b
|
data/README.md
CHANGED
|
@@ -95,7 +95,14 @@ genuinely bad ref. A selection that comes up empty stays exit `0` and says WHY
|
|
|
95
95
|
on stderr — the exit contract is unchanged; only the WHY is truthful now.
|
|
96
96
|
|
|
97
97
|
Files are **positional** (`specguard-lint spec/order_spec.rb`); there is no `--source` flag —
|
|
98
|
-
that belongs to `validate-intent`, not to this one.
|
|
98
|
+
that belongs to `validate-intent`, not to this one. Named paths must be **files**: a directory
|
|
99
|
+
named as a positional argument is a usage error (exit `2`, `<path> is a directory; name files or
|
|
100
|
+
run without paths`). The `validate-intent` binary would expand it as `DIR/**`, but its report
|
|
101
|
+
carries only findings, so a clean file in that subtree appears nowhere and the linter could not
|
|
102
|
+
honestly say what it checked — the run would contradict itself, counting one selected file beside
|
|
103
|
+
several annotations and naming the directory as carrying none. Name the files, or pass no paths
|
|
104
|
+
at all and let the walker select them. A path that does *not* exist is not refused here: it
|
|
105
|
+
reaches the binary and comes back as a read finding, which is where a typo belongs.
|
|
99
106
|
|
|
100
107
|
The linter is a thin CLI over the [`validate-intent`](https://github.com/yatfa-ai/open-test-intent)
|
|
101
108
|
binary — the protocol's own reference implementation, which decides whether an annotation is valid
|
|
@@ -316,7 +323,9 @@ provenance line says which kind of "could not check" it was, in its own words:
|
|
|
316
323
|
The gem's arguments are paths; the binary's are glob patterns. A path that matches nothing —
|
|
317
324
|
missing, or not a regular file — reaches the gem as the same answer the binary gives both shapes
|
|
318
325
|
(`no-match`), which the CLI re-words as `could not read file: no file at this path` and folds into
|
|
319
|
-
the `read` kind.
|
|
326
|
+
the `read` kind. A **directory** is not one of those shapes: the client refuses it up front (see
|
|
327
|
+
"Files are positional" above), so it never reaches the binary and never becomes a read finding.
|
|
328
|
+
The binary's own UTF-8 refusal prose (`input is not well-formed UTF-8
|
|
320
329
|
(PROTOCOL.md §1.1 requires it)`) and parse-failure prose are passed through unaltered.
|
|
321
330
|
|
|
322
331
|
Every way the backend can fail — the binary is missing, will not execute, exits with something that
|
data/lib/specguard/rspec/cli.rb
CHANGED
|
@@ -248,6 +248,28 @@ module SpecGuard
|
|
|
248
248
|
"(named files are checked as given, --changed derives them from the diff)"
|
|
249
249
|
end
|
|
250
250
|
|
|
251
|
+
# SPGD-1303: a directory named as an explicit path is refused, not
|
|
252
|
+
# expanded. The shared `validate-intent` binary learned to expand a
|
|
253
|
+
# bare directory as `DIR/**` (oti SPGD-1299), so one argument stopped
|
|
254
|
+
# meaning one file — and the client's document carries only FINDINGS,
|
|
255
|
+
# so a clean file in that subtree appears nowhere and "checked N spec
|
|
256
|
+
# files" can never count what was actually validated. The observed
|
|
257
|
+
# result was a run whose header said `checked 1 spec file`, whose
|
|
258
|
+
# summary said `checked 3 @intent annotations`, and whose
|
|
259
|
+
# zero-annotation note claimed the directory carried none — three
|
|
260
|
+
# mutually contradicting sentences, and at its sharpest an exit-0
|
|
261
|
+
# false green. Honest accounting is impossible here without an oti
|
|
262
|
+
# wire-contract change, so refusal is the only coherent client-side
|
|
263
|
+
# state. Same sentence as the ts client's `discover.ts` explicit arm.
|
|
264
|
+
# `File.directory?` follows symlinks, so a symlinked directory is the
|
|
265
|
+
# same class; a nonexistent path is NOT a directory and still reaches
|
|
266
|
+
# the binary, where the no-match finding belongs.
|
|
267
|
+
options[:files].each do |path|
|
|
268
|
+
next unless File.directory?(path)
|
|
269
|
+
|
|
270
|
+
raise UsageError, "#{path} is a directory; name files or run without paths"
|
|
271
|
+
end
|
|
272
|
+
|
|
251
273
|
return FileSelector::Selection.new(files: options[:files], mode: :explicit)
|
|
252
274
|
end
|
|
253
275
|
|
data/lib/specguard/version.rb
CHANGED