@orkestrel/guide 0.0.21 → 0.0.22

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.
@@ -852,6 +852,23 @@ function findMissingSymbols(symbols, source) {
852
852
  return findMissing(symbols.map(computeSymbolKey), source.map(computeSymbolKey));
853
853
  }
854
854
  /**
855
+ * Checks whether a source declares at least one behavioural member — a `class` or `interface`
856
+ * in its surface that carries a call-signature member — so a guide owes a `## Methods` group only
857
+ * where the source has one to document.
858
+ *
859
+ * @param source - The reflected source under parity
860
+ * @returns True if a surface `class` or `interface` declares a member; false otherwise
861
+ *
862
+ * @example
863
+ * ```ts
864
+ * hasBehaviouralSurface(createSource({ files: { 'src/types.ts': 'export interface Widget { render(): void }' }, module: 'src' })) // true
865
+ * hasBehaviouralSurface(createSource({ files: { 'src/constants.ts': 'export const NAMES = Object.freeze({})' }, module: 'src' })) // false
866
+ * ```
867
+ */
868
+ function hasBehaviouralSurface(source) {
869
+ return source.surface().some((symbol) => (symbol.keyword === "class" || symbol.keyword === "interface") && source.methods(symbol.name).length > 0);
870
+ }
871
+ /**
855
872
  * Finds the names in `names` that have no example — a fence containing the name at a
856
873
  * word boundary in `fences`, or a membership in `examples`, both count as
857
874
  * "has an example"; presence-only, fence and JSDoc content are never checked.
@@ -3616,7 +3633,7 @@ var Parity = class Parity {
3616
3633
  text: `${row.entry.spec} has no ## ${heading} section.`
3617
3634
  });
3618
3635
  }
3619
- if (row.guide.methods().length === 0) findings.push({
3636
+ if (row.guide.methods().length === 0 && hasBehaviouralSurface(row.source)) findings.push({
3620
3637
  spec: row.entry.spec,
3621
3638
  text: `${row.entry.spec} has no documented method groups.`
3622
3639
  });
@@ -4160,6 +4177,7 @@ exports.findUnexampled = findUnexampled;
4160
4177
  exports.findUnlisted = findUnlisted;
4161
4178
  exports.formatDrift = formatDrift;
4162
4179
  exports.formatSide = formatSide;
4180
+ exports.hasBehaviouralSurface = hasBehaviouralSurface;
4163
4181
  exports.hasCanonicalSegments = hasCanonicalSegments;
4164
4182
  exports.identifyDrift = identifyDrift;
4165
4183
  exports.isDrift = isDrift;