docs(releaser): release v1.5.1 — documentation site, fuzzing completeness
ci / vet, staticcheck, test, build (push) Failing after 3m50s
ci / vet, staticcheck, test, build (push) Failing after 3m50s
- Add Hugo + Geekdoc documentation site (docs/): installation, CLI reference, configuration, CI integration, and changelog pages; explicit menu bundle nav so all pages appear in the sidebar on every page - Add Gitea CI workflow (.gitea/workflows/docs.yml): builds on push to main when docs/** changes, deploys minified site to gh-pages branch - Add docs:setup / docs:serve / docs:build Taskfile tasks; theme bundle downloaded at build time (not committed) - Add FuzzUpdate to internal/changelog and FuzzWriteVersion to internal/node to complete fuzz coverage for all file-rewriting packages - Add fuzzing completeness guidelines to CLAUDE.md: authoritative table, exempt-package rationale, seed corpus rules Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -149,3 +149,22 @@ func TestUpdateIdempotent(t *testing.T) {
|
||||
t.Error("version heading should appear exactly once after idempotent call")
|
||||
}
|
||||
}
|
||||
|
||||
// FuzzUpdate verifies Update never panics on arbitrary existing file content or commit messages.
|
||||
func FuzzUpdate(f *testing.F) {
|
||||
f.Add("", "feat: add thing")
|
||||
f.Add("# Changelog\n\n## [1.0.0] - 2026-01-01\n\n### Added\n- something\n", "fix: something")
|
||||
f.Add("some preamble\n", "feat!: breaking change")
|
||||
f.Add("\n## [2.0.0] - 2026-01-01\n", "feat: another thing")
|
||||
f.Add("", "chore: no release")
|
||||
f.Add("", "")
|
||||
|
||||
f.Fuzz(func(t *testing.T, existing, message string) {
|
||||
dir := t.TempDir()
|
||||
path := filepath.Join(dir, "CHANGELOG.md")
|
||||
if existing != "" {
|
||||
os.WriteFile(path, []byte(existing), 0644) //nolint:errcheck
|
||||
}
|
||||
Update(path, "v1.0.0", "1.0.0", []string{message}) //nolint:errcheck
|
||||
})
|
||||
}
|
||||
|
||||
@@ -82,6 +82,21 @@ func TestWriteVersionNotFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// FuzzWriteVersion verifies WriteVersion never panics on arbitrary content or version strings.
|
||||
func FuzzWriteVersion(f *testing.F) {
|
||||
f.Add(simplePackage, "1.2.3", "1.2.4")
|
||||
f.Add(`{"version":"0.0.1"}`, "0.0.1", "0.0.2")
|
||||
f.Add(`{}`, "1.0.0", "1.0.1")
|
||||
f.Add("", "1.0.0", "1.0.1")
|
||||
f.Add(`{"name":"app","version":"1.0.0","version":"dup"}`, "1.0.0", "1.0.1")
|
||||
|
||||
f.Fuzz(func(t *testing.T, content, oldVersion, newVersion string) {
|
||||
path := filepath.Join(t.TempDir(), "package.json")
|
||||
os.WriteFile(path, []byte(content), 0644) //nolint:errcheck
|
||||
WriteVersion(path, oldVersion, newVersion) //nolint:errcheck
|
||||
})
|
||||
}
|
||||
|
||||
// FuzzReadVersion verifies ReadVersion never panics on arbitrary content.
|
||||
func FuzzReadVersion(f *testing.F) {
|
||||
f.Add(simplePackage)
|
||||
|
||||
Reference in New Issue
Block a user