Now let me read the actual Ruby source files and fixtures to get exact content for porting.
Let me also fix the lint diagnostic about slices.Contains:
I need to also fix the closing brace:
Looks correct. Let me run tests again:
All 38 tests pass, go vet clean. Now let me initialize the git repo, set it up with the remote, commit, and push.
Done. Here's what was created at github.com/git-pkgs/changelog:
Library (changelog.go) - 430 lines porting the Ruby gem's parsing logic:
Parse, ParseWithFormat, ParseWithPattern, ParseFile, FindChangelog, FindAndParse constructorsVersions(), Entry(), Entries(), Between(), LineForVersion() methodsTests (changelog_test.go) - 38 tests covering all Ruby gem test cases: format detection, all three formats with fixtures, custom patterns, Between method, LineForVersion edge cases (substring avoidance, range avoidance, v-prefix), prerelease/build metadata, markdown preservation, and the comprehensive fixture.
Infrastructure - CI workflow matching vers (Go 1.25, build/test/lint), zizmor workflow, MIT license, .gitignore, and README with usage examples.
CI failed. Let me check what went wrong.
Lint errcheck on an unchecked os.WriteFile in the test. Quick fix:
Now let me wait for CI to finish.
CI passed. Tagging v0.1.0.
Tagged and pushed v0.1.0.
No changes - go.mod was already tidy (no dependencies to resolve).
I see the current list. Let me also check which of these repos are actually public/library modules vs internal tools, so I only add what belongs.
Here's the diff:
Added changelog in alphabetical order with the other libraries. Ready for you to review before committing/pushing.
Let me check which repos are actually public on the org.
Comparing against what's currently listed, these public library repos are missing:
Six missing libraries added (archives, changelog, enrichment, forges, gitignore, platforms, vulns), all alphabetical. I left out non-library repos like resolve, proxy, website, demo, testing, homebrew-git-pkgs, and packageurl-go since the section is titled "Libraries". Ready when you want to commit.
Ready for review.
Remote is ahead. Let me pull and retry.
Pushed.
A few options, though nothing as complete as scancode:
google/licensecheck is probably the closest to what you want. It's a library (not just a CLI) that classifies license text by matching against known licenses. Used internally by the Go module proxy for license detection on pkg.go.dev. No copyright detection though.
go-license-detector from source{d} does file-level license detection using TF-IDF similarity against SPDX license texts. Good accuracy but the repo hasn't been maintained since ~2020 (source{d} folded).
IBM/license-scanner matches against SPDX license templates and has some copyright/keyword detection support. More active than go-license-detector.
jfrog/go-license-discovery is another matching library, from JFrog.
google/go-licenses and mitchellh/golicense are CLIs for scanning Go module dependencies specifically, not general-purpose file scanners.
None of them do copyright holder extraction the way scancode does. If you need both license and copyright detection in Go, you'd likely end up wrapping scancode or porting parts of it. Were you thinking of building something for git-pkgs?
Doesn't look like it. The REUSE tool itself is Python, and I couldn't find a Go library that implements the REUSE spec (checking for SPDX headers in every file, .reuse/dep5 parsing, REUSE.toml, etc.).
The closest things in Go are tangential:
If you wanted REUSE compliance checking as a Go library you'd be building it from scratch. The spec itself isn't huge though -- it's mostly about finding SPDX-License-Identifier/SPDX-FileCopyrightText tags in files, falling back to .license sidecar files, and parsing REUSE.toml or .reuse/dep5. Were you thinking about adding REUSE support to git-pkgs?
Sources:
Let me start by exploring the REUSE spec, the folder the user created, and the existing git-pkgs patterns.
Let me dig deeper into the spec repo and test suite before designing the plan.
Let me look at the actual test fixtures in the reuse-tool to understand the test structure, and check the spec repo for a formal test suite.
Good to know - parsing focus, not linting/CLI. Let me read the key Python source files for the parsing logic.
Good. Now I have a thorough understanding of the parsing logic. Let me design the plan.
Now let me write the plan file.
Now let me look at the vers package for LICENSE, workflow files, and README patterns.
Good - BurntSushi/toml and raw strings for SPDX expressions. That keeps dependencies minimal. Let me update the plan accordingly.
Now let me check if there's a zizmor config in any of the other packages.
I'll start by examining the existing sibling packages for patterns and the Ruby gem for the logic to port.
Good. Now I have everything I need. Let me create the changelog directory and all the files.
Now the workflow files:
Now the test fixture files: