[spec-enforcer] Enforce specifications for jsonutil, linters, logger#34416
Merged
pelikhan merged 1 commit intoMay 24, 2026
Merged
Conversation
- linters: add spec tests for `errormessage.Analyzer`, `ssljson.Analyzer`, and the namespace-level compatibility alias `linters.ErrorMessageAnalyzer` documented in the README Subpackages and Namespace exports tables. Extend TestSpec_UsageExample_AnalyzersUsable and TestSpec_DesignDecision_UniqueAnalyzerNames to cover all five documented subpackages. - logger: replace the tautological `HasSuffix(stripped, output[:len(output)-1])` clause in TestSpec_PublicAPI_Printf with a direct `Contains(output, "+")` check, which is what the spec's documented `+<timediff>` format actually requires. - jsonutil: reviewed — existing spec_test.go already fully covers the documented `MarshalCompactNoHTMLEscape` contract; no changes needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Specification Test Enforcement
This PR updates specification-driven tests for three packages drawn from the round-robin rotation (
last_index=8→9, 10, 11).pkg/jsonutilpkg/linterspkg/loggerTest Derivation
All tests are derived from each package's
README.mdspecification, not from implementation source code. Only minimal source reading was performed — to confirm exported names and signatures.Changes by Package
pkg/linters— the README documents five subpackages (excessivefuncparams,errormessage,largefunc,osexitinlibrary,ssljson) and a namespace-level compatibility alias (ErrorMessageAnalyzer). The previous spec tests only covered four subpackages and did not exercise the documented alias.TestSpec_PublicAPI_ErrorMessageAnalyzer(validateserrormessage.Analyzerper the Subpackages table).TestSpec_PublicAPI_SSLJsonAnalyzer(validatesssljson.Analyzerper the Subpackages table — previously only indirectly exercised).TestSpec_NamespaceExports_ErrorMessageAnalyzer(validateslinters.ErrorMessageAnalyzer == errormessage.Analyzerper the Namespace exports table).TestSpec_UsageExample_AnalyzersUsableandTestSpec_DesignDecision_UniqueAnalyzerNamesto include all five documented analyzers.pkg/logger— fixed a tautological assertion inTestSpec_PublicAPI_Printf. The original assertion was:The first half evaluates to
HasSuffix(X, X), which is always true whenoutputends with a single newline, so the assertion never actually verified the documented+<timediff>format. Replaced with the direct checkContains(output, "+").pkg/jsonutil— existing tests already cover the documentedMarshalCompactNoHTMLEscapecontract (HTML escaping disabled for&,<,>; trailing newline trimmed; GitHub Actions expression operators preserved). No changes needed.Spec-Implementation Mismatches
None observed.
Round-Robin State
jsonutil,linters,loggerparser,repoutil,semverutilREADME.md)Auto-generated by Package Specification Enforcer workflow
References: