specguard-ruby 0.3.11 → 0.3.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e274f554d8e8271f6fe4b096963e59a1a58579a2c09b772eaded70a7a0a4fbd5
4
- data.tar.gz: f967409a020a45d16f79b53edf89edae5c04f9a80118169ffc774ea8d4b772f5
3
+ metadata.gz: d6e99d2df23601a1d6118d833c56b67b868fe3e02598bbc67d097a0eb491d6a7
4
+ data.tar.gz: ccef4a5ca06af0fa84e66091725bbdeb6b8ba5627a49d14e8ae7f51d19860c28
5
5
  SHA512:
6
- metadata.gz: 6fd5fae21c02ed7bafd55e59f17ed26ab25f383330fd43d7220cc1c584f88101f19534e108fa2eb762d992d7f73a307011f589bd6c84d1fb5551db52e76672f3
7
- data.tar.gz: aa9e90a632a41dd09033517f20afbb80b6b2169990365ea73a6d6bd0a457afb2fab17eb3260b3ac07698898e1b0226b215df88fb06c139e7bc236802c493e0fd
6
+ metadata.gz: 2bc085f8cfa17d999856abf4d161f2c6a1b1bbd58ee626c89b4a55de51c3dcf9e1b7ad8ee1a919dd9090cd3fa510eaec7ff4bf93a4bc7a51f9830faeec1c5b99
7
+ data.tar.gz: c1aba6267102cbedf20135a3d7ad9010c3742e7c7405b88f34a374281b3b3f78ef349765638db34d01d8a4eaa9f393ce8a77def353de7a1bd79cdb08f1517343
@@ -156,7 +156,11 @@ module SpecGuard
156
156
  # `ok` is derived FROM it rather than recomputed from the findings, so
157
157
  # the two renderers cannot disagree about whether the run passed.
158
158
  code = results.any?(&:failed?) ? EXIT_MALFORMED : EXIT_OK
159
- report_results(results, files: selection.count, json: options[:json], ok: code == EXIT_OK)
159
+ # The selection's file LIST rides along (the `files:` count stays what
160
+ # the document's summary consumes) because the coverage note is about
161
+ # which files were checked, not how many.
162
+ report_results(results, files: selection.count, selected_files: selection.files,
163
+ json: options[:json], ok: code == EXIT_OK)
160
164
 
161
165
  code
162
166
  rescue UsageError, ValidatorError => e
@@ -355,9 +359,11 @@ module SpecGuard
355
359
  # statements about the same numbers, and a linter whose two renderers can
356
360
  # disagree about how much it checked is worse than one that only prints
357
361
  # prose: the disagreement is unfalsifiable from outside the process.
358
- def report_results(results, files:, json:, ok:)
362
+ def report_results(results, files:, selected_files:, json:, ok:)
359
363
  annotations, unread = results.partition(&:line_scoped?)
360
364
 
365
+ report_zero_annotation_files(selected_files, annotations, unread)
366
+
361
367
  if json
362
368
  @stdout.puts JSONReporter.render(results, files: files, annotations: annotations.length, ok: ok)
363
369
  return
@@ -368,6 +374,43 @@ module SpecGuard
368
374
  @stdout.puts summary_line(annotations, unread)
369
375
  end
370
376
 
377
+ # The coverage note: which of the checked files were read and yielded no
378
+ # `@intent` annotation at all. Zero findings on stdout (or an empty
379
+ # `findings` list in the document) is otherwise ambiguous between
380
+ # "every checked file was annotated and valid" and "half the checked
381
+ # files carry nothing" — and the missing-annotation question is the most
382
+ # actionable one this tool touches, because the bridge agent reading
383
+ # `linter_stderr` has no other view into the repository's spec files.
384
+ #
385
+ # The boundary is the set-difference the partition above already
386
+ # supports: a file counts as covered when it yielded any line-scoped
387
+ # result (an annotation, valid or not — the SPGD-900 unreachable findings
388
+ # are line-scoped too and require an annotation to exist, so they cover
389
+ # their file) or when it could not be read at all (KIND_READ → `unread`).
390
+ # An unread file is NOT a zero-annotation file: it already gets its own
391
+ # summary clause and FAIL line, and calling it annotation-free would be
392
+ # the same overstatement `summary_line` refuses to make. Unreachable
393
+ # findings need a stacked annotation — impossible in a file with none —
394
+ # so `annotations ∪ unread` already covers every non-bare file and no
395
+ # third subtraction is needed.
396
+ #
397
+ # It is a NOTE on stderr, never a warning and never an exit code: "lint,
398
+ # don't require" (SPGD-12 §1) keeps a missing annotation a non-error.
399
+ # It is emitted before the json early-return so both renderers get it —
400
+ # stderr is renderer-indifferent (SPGD-247; the SPGD-1134 selection
401
+ # sentence is the landed precedent, and the bridge forwards stderr
402
+ # verbatim as `linter_stderr`). The prefix is deliberately not
403
+ # `specguard-lint: checked`, which the selection-sentence pin counts.
404
+ def report_zero_annotation_files(selected_files, annotations, unread)
405
+ bare = selected_files - annotations.map(&:file) - unread.map(&:file)
406
+ return if bare.empty?
407
+
408
+ verb = bare.length == 1 ? "carries" : "carry"
409
+ @stderr.puts "specguard-lint: note: #{bare.length} of #{selected_files.length} checked " \
410
+ "spec file#{'s' unless selected_files.length == 1} #{verb} no @intent " \
411
+ "annotations: #{bare.join(', ')}"
412
+ end
413
+
371
414
  # The summary line exists for one reason — so "checked nothing" can never
372
415
  # read as "all clean" — which makes overstating what was inspected its
373
416
  # own kind of lie. A file that could not be opened contributed no
@@ -7,5 +7,5 @@
7
7
  # framework-scoped version constant a lie, so the number moved here and the
8
8
  # rspec module now points at it for back-compat.
9
9
  module SpecGuard
10
- VERSION = "0.3.11"
10
+ VERSION = "0.3.13"
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specguard-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - specguard Agent
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-15 00:00:00.000000000 Z
11
+ date: 2026-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json