diff --git a/CHANGELOG.md b/CHANGELOG.md index fbbd2d1..875bb78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -227,6 +227,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 no cached database the command no longer tries to download one from GitHub first. The exit code is still 2. +- **The README showed a `go report: A` badge that nothing measured.** It was a + shields.io static badge, which draws the value written into its URL, and it + linked to a goreportcard.com report. The goreportcard.com badge for the + module read `go report: retired` on 2026-10-17. The badge is removed. + ## [1.3.1] - 2026-10-17 ### Fixed diff --git a/README.md b/README.md index ffd5377..86848d0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ Find the cryptography your dependencies bring in, see which of it quantum computers will break, and tell apart what your code actually calls from what is merely available to it. [![CI](https://github.com/csnp/qramm-cryptodeps/actions/workflows/ci.yml/badge.svg)](https://github.com/csnp/qramm-cryptodeps/actions/workflows/ci.yml) -[![Go Report Card](https://img.shields.io/badge/go%20report-A-brightgreen)](https://goreportcard.com/report/github.com/csnp/qramm-cryptodeps) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) [![Go Version](https://img.shields.io/github/go-mod/go-version/csnp/qramm-cryptodeps)](go.mod) diff --git a/cmd/cryptodeps/docs_badges_test.go b/cmd/cryptodeps/docs_badges_test.go new file mode 100644 index 0000000..a514863 --- /dev/null +++ b/cmd/cryptodeps/docs_badges_test.go @@ -0,0 +1,128 @@ +// Copyright 2025-2026 CyberSecurity NonProfit (CSNP) +// SPDX-License-Identifier: Apache-2.0 + +package main + +import ( + "net/url" + "os" + "path/filepath" + "regexp" + "strings" + "testing" +) + +// readmeBadge matches a linked badge image, [![alt](image)](link). +var readmeBadge = regexp.MustCompile(`\[!\[([^\]]*)\]\(([^)\s]+)\)\]\(([^)\s]+)\)`) + +// staticBadgeMessage returns the value a shields.io static badge draws, and +// false for any other image. A static badge draws the value written into its +// URL, as /badge/