Repository navigation
Fail the README badge test on a static badge whose value the linked file holds only inside longer words, or that links back to README.md (#56) - #59
Merged
Conversation
…ile holds only inside longer words, or that links back to README.md (#56) TestDocsReadmeBadgesTakeTheirValuesFromASource passed a shields.io static badge when the file it linked to contained each word of the badge value as a substring, ignoring case. With [](go.mod) inserted after README.md line 7 the test passed, because go.mod has the letter a inside words such as cobra and yaml. It also passed with the same badge linking to README.md, and with [](LICENSE), because LICENSE has mit inside submit, submitted, limited and limitation. repoFileHolds now looks for each word of the value as a whole word, with no letter, number or underscore beside it, still ignoring case. Whole words alone would still pass the badge that links to README.md, which has the word a on 8 lines, so a link back to the file the badge is drawn in does not count either. With the three badges above inserted after README.md line 7, the test fails at README.md:8, 9 and 10, and the Apache 2.0 License badge that links to LICENSE still passes. The same go report: A badge linking to goreportcard.com, and a B+ grade linking to go.mod, still fail. TestHoldsWords covers the whole-word match, including the value B+, which \b would not match before a newline or at the end of the text. TestRepoFileHolds runs repoFileHolds on the badges above; against the old repoFileHolds, its go.mod, README.md, ./README.md#readme and MIT cases fail. Fixes #56
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.
This pull request lands 1 commit in
cmd/cryptodeps/docs_badges_test.go.Included
Verified on this exact tree
go build ./...: exit 0go vet ./...: exit 0golangci-lint run ./...with golangci-lint 2.12.2: exit 3,can't load config: unsupported version of the configuration: ""; the same error and exit 3 onorigin/main(pre-existing)golangci-lint run --no-config --default=none -E errcheck -E govet -E ineffassign -E staticcheck -E unused ./cmd/cryptodeps/: 3 issues (errcheck: 2, staticcheck: 1), incmd/cryptodeps/offline_test.goandcmd/cryptodeps/main.go; the same 3 issues onorigin/maingo test -p 4 -race -count=1 -json ./...: exit 0; packages: 13 ok, 0 failed, 3 with no test files; top-level tests: 528 passed, 0 failed, 1 skipped (TestIntegration_FetchPyPIPackage:pip not available, skipping test); subtests: 1099 passed, 0 failed, 0 skippedNot included
go test -count=1 ./internal/manifest/with it applied onorigin/mainfailed inTestRequirementsTxtVersionEndsWithItsSpecifier, 3 subtests, for exampledependency = cryptography ">=41.0, <43" at line 1, want cryptography "41.0, <43" at line 1; the same test passes onorigin/maingit cherry-pick 68e9c1e6d4after the included commit stopped with a conflict incmd/cryptodeps/docs_badges_test.goCloses
Fixes #56
How to merge
Rebase and merge, so that each change stays its own commit on
main.