From fdfa2abe20bf31dd8f295c765ca7950eca3adc39 Mon Sep 17 00:00:00 2001 From: Abdel Fane <32418586+thebenignhacker@users.noreply.github.com> Date: Sat, 17 Oct 2026 13:50:01 -0600 Subject: [PATCH] Remove the "go report: A" badge from the README header, a shields.io static badge whose grade was written into its URL (#51) README.md line 8 drew its "go report: A" badge from https://img.shields.io/badge/go%20report-A-brightgreen. That is a shields.io static badge, which draws the value written into its URL: on 2026-10-17 the same URL with F in place of A drew "go report: F". The badge linked to a goreportcard.com report, and the goreportcard.com badge for the module drew "go report: retired" that day. The badge is removed. The CI, License and Go Version badges are unchanged. TestDocsReadmeBadgesTakeTheirValuesFromASource reads the README badges and fails on a shields.io static badge unless it links to a file in the repository that holds its value, as the License badge links to LICENSE. On the README before this change it fails at README.md:8, and it passes after. TestStaticBadgeMessage checks which badge URLs are static and the value read from each static one, against what shields.io drew for them on 2026-10-17. Fixes #51 --- CHANGELOG.md | 5 ++ README.md | 1 - cmd/cryptodeps/docs_badges_test.go | 128 +++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 cmd/cryptodeps/docs_badges_test.go 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/