featureparity 0.0.10 → 0.0.11
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/lib/fp/commands/check.rb +33 -0
- data/lib/fp/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: f3bf1014e57b31bb56a73f768b635114ea15621f81986e0f8e94aded5c32c06b
|
|
4
|
+
data.tar.gz: edc45b069c7cee17cfd382096db52d1a835cbecb3a0af1d19652c4ee242aacef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 87f36cb76299fc104298a23ed41cb9e6ab82e54fa773f88a8808f32758e77f1c9e7373476e8d843bc7ed0fd1df6fbc7471491cec14217c5a41eb7a7d67613843
|
|
7
|
+
data.tar.gz: 73f0e7fc3e58db8acebd37ad645e8a2a0dca300b54db51aa31d84a8d5727726c1e4fc24f40dc69b7d4c57959922d2fbc14d97ad50bf2ca2bbb42eff86010e4ba
|
data/lib/fp/commands/check.rb
CHANGED
|
@@ -180,6 +180,7 @@ module Fp
|
|
|
180
180
|
|
|
181
181
|
print_state_counts(summary)
|
|
182
182
|
print_violations(violations)
|
|
183
|
+
print_orphans(report)
|
|
183
184
|
print_pending_reviews(report, project_slug)
|
|
184
185
|
print_unscoped_warning(summary, project_slug)
|
|
185
186
|
print_verdict(passed, violations, opts)
|
|
@@ -227,6 +228,38 @@ module Fp
|
|
|
227
228
|
puts
|
|
228
229
|
end
|
|
229
230
|
|
|
231
|
+
# Markers the run carried that bind to no requirement in this project — the test
|
|
232
|
+
# claims to cover something that doesn't exist. FP identifies them; it does not
|
|
233
|
+
# propose the requirement, because a slug and a test name aren't enough to write a
|
|
234
|
+
# good one. Whether this fails the build is the server's call (orphans_violate,
|
|
235
|
+
# true at covered/strict), already folded into `passing` — here we only render it,
|
|
236
|
+
# as a violation when it counts and a note when it doesn't. Only the --junit path
|
|
237
|
+
# has a run to find these in; plain `fp check` reads recorded state and shows none.
|
|
238
|
+
def print_orphans(report)
|
|
239
|
+
orphans = report['orphans'] || []
|
|
240
|
+
return if orphans.empty?
|
|
241
|
+
|
|
242
|
+
violates = report['orphans_violate']
|
|
243
|
+
lead = violates ? "#{orphans.size} orphan marker(s) — a violation at this level:" \
|
|
244
|
+
: "#{orphans.size} orphan marker(s) (not failing the gate at this level):"
|
|
245
|
+
puts lead
|
|
246
|
+
output.table(
|
|
247
|
+
%w[SLUG SURFACE WHERE],
|
|
248
|
+
orphans.map { |o| [o['slug'], o['surface'], marker_location(o)] }
|
|
249
|
+
)
|
|
250
|
+
puts 'These tests are marked fp:<slug> for a requirement that does not exist. ' \
|
|
251
|
+
'Either propose it (fp propose --slug <slug> ...) or fix the marker\'s slug — ' \
|
|
252
|
+
'FP will not invent a requirement from a marker.'
|
|
253
|
+
puts
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
def marker_location(orphan)
|
|
257
|
+
file = orphan['source_file']
|
|
258
|
+
return '—' if file.nil? || file.empty?
|
|
259
|
+
|
|
260
|
+
orphan['source_line'] ? "#{file}:#{orphan['source_line']}" : file
|
|
261
|
+
end
|
|
262
|
+
|
|
230
263
|
# Informational, never a violation: an active requirement naming no surface this
|
|
231
264
|
# project has can't be satisfied, so it would pass any gate silently. Worth
|
|
232
265
|
# saying out loud without blocking a merge on someone else's data-entry gap.
|
data/lib/fp/version.rb
CHANGED