Updated task #6 status
Updated task #7 status
Now I need to add assertSlice to covered_test.go (since it's used by both covered_test.go and project_test.go in the root package, and extract_test.go which defined it is moving away). And delete the old files from root.
Now delete the old files from root:
rm /Users/andrew/code/git-pkgs/reuse/extract.go /Users/andrew/code/git-pkgs/reuse/extract_test.go /Users/andrew/code/git-pkgs/reuse/dep5.go /Users/andrew/code/git-pkgs/reuse/dep5_test.go /Users/andrew/code/git-pkgs/reuse/toml.go /Users/andrew/code/git-pkgs/reuse/toml_test.go /Users/andrew/code/git-pkgs/reuse/glob.go /Users/andrew/code/git-pkgs/reuse/glob_test.go(empty result)
The diagnostic is just a lag from the old files. Let me now build and test.
The diagnostic is stale from before the delete. Let me build and test:
cd /Users/andrew/code/git-pkgs/reuse && go build ./...(empty result)
go vet ./...(empty result)
go test -v -race ./...=== RUN TestIsIgnoredDir
--- PASS: TestIsIgnoredDir (0.00s)
=== RUN TestIsIgnoredFile
--- PASS: TestIsIgnoredFile (0.00s)
=== RUN TestIsCoveredFile
--- PASS: TestIsCoveredFile (0.00s)
=== RUN TestCoveredFiles
--- PASS: TestCoveredFiles (0.00s)
=== RUN TestCoveredFiles_NoSymlinks
--- PASS: TestCoveredFiles_NoSymlinks (0.00s)
=== RUN TestOpenProject_WithReuseTOML
--- PASS: TestOpenProject_WithReuseTOML (0.00s)
=== RUN TestOpenProject_WithDep5
--- PASS: TestOpenProject_WithDep5 (0.00s)
=== RUN TestOpenProject_HeaderOnly
--- PASS: TestOpenProject_HeaderOnly (0.00s)
=== RUN TestProject_ReuseInfoOf_FileHeader
--- PASS: TestProject_ReuseInfoOf_FileHeader (0.00s)
=== RUN TestProject_ReuseInfoOf_DotLicenseSidecar
--- PASS: TestProject_ReuseInfoOf_DotLicenseSidecar (0.00s)
=== RUN TestProject_ReuseInfoOf_Override
--- PASS: TestProject_ReuseInfoOf_Override (0.00s)
=== RUN TestProject_ReuseInfoOf_Closest
--- PASS: TestProject_ReuseInfoOf_Closest (0.00s)
=== RUN TestProject_ReuseInfoOf_ClosestPartial
--- PASS: TestProject_ReuseInfoOf_ClosestPartial (0.00s)
=== RUN TestProject_ReuseInfoOf_Aggregate
--- PASS: TestProject_ReuseInfoOf_Aggregate (0.00s)
=== RUN TestProject_ReuseInfoOf_Dep5
--- PASS: TestProject_ReuseInfoOf_Dep5 (0.00s)
=== RUN TestProject_ReuseInfoOf_SidecarOverridesAll
--- PASS: TestProject_ReuseInfoOf_SidecarOverridesAll (0.00s)
=== RUN TestProject_AllReuseInfo
--- PASS: TestProject_AllReuseInfo (0.00s)
=== RUN TestProject_ReuseExample
--- PASS: TestProject_ReuseExample (0.00s)
=== RUN TestProject_FakeRepository
--- PASS: TestProject_FakeRepository (0.00s)
PASS
ok github.com/git-pkgs/reuse 1.387s
=== RUN TestParseDep5_Valid
--- PASS: TestParseDep5_Valid (0.00s)
=== RUN TestParseDep5_MultiLineCopyright
--- PASS: TestParseDep5_MultiLineCopyright (0.00s)
=== RUN TestParseDep5_ContinuationDot
--- PASS: TestParseDep5_ContinuationDot (0.00s)
=== RUN TestParseDep5_WildcardPatterns
--- PASS: TestParseDep5_WildcardPatterns (0.00s)
=== RUN TestParseDep5_MultiplePatterns
--- PASS: TestParseDep5_MultiplePatterns (0.00s)
=== RUN TestParseDep5_MissingFields
=== RUN TestParseDep5_MissingFields/missing_copyright
=== RUN TestParseDep5_MissingFields/missing_license
=== RUN TestParseDep5_MissingFields/missing_files
--- PASS: TestParseDep5_MissingFields (0.00s)
--- PASS: TestParseDep5_MissingFields/missing_copyright (0.00s)
--- PASS: TestParseDep5_MissingFields/missing_license (0.00s)
--- PASS: TestParseDep5_MissingFields/missing_files (0.00s)
=== RUN TestParseDep5_Empty
--- PASS: TestParseDep5_Empty (0.00s)
=== RUN TestParseDep5File
--- PASS: TestParseDep5File (0.00s)
=== RUN TestDep5_ReuseInfoOf_NoMatch
--- PASS: TestDep5_ReuseInfoOf_NoMatch (0.00s)
=== RUN TestDep5_ReuseInfoOf_SourceType
--- PASS: TestDep5_ReuseInfoOf_SourceType (0.00s)
=== RUN TestDep5_QuestionMark
--- PASS: TestDep5_QuestionMark (0.00s)
PASS
ok github.com/git-pkgs/reuse/dep5 1.640s
=== RUN TestExtractReuseInfo_CStyleComment
--- PASS: TestExtractReuseInfo_CStyleComment (0.00s)
=== RUN TestExtractReuseInfo_HashComment
--- PASS: TestExtractReuseInfo_HashComment (0.00s)
=== RUN TestExtractReuseInfo_DoubleSlashComment
--- PASS: TestExtractReuseInfo_DoubleSlashComment (0.00s)
=== RUN TestExtractReuseInfo_DashDashComment
--- PASS: TestExtractReuseInfo_DashDashComment (0.00s)
=== RUN TestExtractReuseInfo_HTMLComment
--- PASS: TestExtractReuseInfo_HTMLComment (0.00s)
=== RUN TestExtractReuseInfo_MultipleLicensesAndCopyrights
--- PASS: TestExtractReuseInfo_MultipleLicensesAndCopyrights (0.00s)
=== RUN TestExtractReuseInfo_ORExpression
--- PASS: TestExtractReuseInfo_ORExpression (0.00s)
=== RUN TestExtractReuseInfo_EmptyText
--- PASS: TestExtractReuseInfo_EmptyText (0.00s)
=== RUN TestExtractReuseInfo_NoTags
--- PASS: TestExtractReuseInfo_NoTags (0.00s)
=== RUN TestExtractReuseInfo_SnippetCopyrightText
--- PASS: TestExtractReuseInfo_SnippetCopyrightText (0.00s)
=== RUN TestExtractReuseInfo_MixedFileAndSnippet
--- PASS: TestExtractReuseInfo_MixedFileAndSnippet (0.00s)
=== RUN TestFilterIgnoreBlocks
--- PASS: TestFilterIgnoreBlocks (0.00s)
=== RUN TestFilterIgnoreBlocks_Unclosed
--- PASS: TestFilterIgnoreBlocks_Unclosed (0.00s)
=== RUN TestFilterIgnoreBlocks_Multiple
--- PASS: TestFilterIgnoreBlocks_Multiple (0.00s)
=== RUN TestFilterIgnoreBlocks_None
--- PASS: TestFilterIgnoreBlocks_None (0.00s)
=== RUN TestExtractReuseInfo_IgnoreBlockHidesTag
--- PASS: TestExtractReuseInfo_IgnoreBlockHidesTag (0.00s)
=== RUN TestExtractReuseInfo_WindowsLineEndings
--- PASS: TestExtractReuseInfo_WindowsLineEndings (0.00s)
=== RUN TestExtractReuseInfo_TrailingCommentMarker
--- PASS: TestExtractReuseInfo_TrailingCommentMarker (0.00s)
=== RUN TestExtractFromFile
--- PASS: TestExtractFromFile (0.00s)
=== RUN TestExtractFromFile_Binary
--- PASS: TestExtractFromFile_Binary (0.00s)
=== RUN TestExtractFromFile_NotFound
--- PASS: TestExtractFromFile_NotFound (0.00s)
=== RUN TestExtractReuseInfo_MalformedTag
--- PASS: TestExtractReuseInfo_MalformedTag (0.00s)
=== RUN TestExtractReuseInfo_LeadingWhitespace
--- PASS: TestExtractReuseInfo_LeadingWhitespace (0.00s)
PASS
ok github.com/git-pkgs/reuse/extract 1.499s
? github.com/git-pkgs/reuse/internal/core [no test files]
=== RUN TestGlobMatch
=== RUN TestGlobMatch/*.go_foo.go
=== RUN TestGlobMatch/*.go_bar.go
=== RUN TestGlobMatch/*.go_dir/foo.go
=== RUN TestGlobMatch/*.go_.hidden.go
=== RUN TestGlobMatch/src/*.py_src/foo.py
=== RUN TestGlobMatch/src/*.py_src/other/foo.py
=== RUN TestGlobMatch/**/*.go_foo.go
=== RUN TestGlobMatch/**/*.go_dir/foo.go
=== RUN TestGlobMatch/**/*.go_dir/sub/foo.go
=== RUN TestGlobMatch/**/*.go_.hidden/foo.go
=== RUN TestGlobMatch/**_anything
=== RUN TestGlobMatch/**_dir/sub/file.txt
=== RUN TestGlobMatch/src/**_src/foo.go
=== RUN TestGlobMatch/src/**_src/sub/foo.go
=== RUN TestGlobMatch/src/**_other/foo.go
=== RUN TestGlobMatch/foo.py_foo.py
=== RUN TestGlobMatch/foo.py_src/foo.py
=== RUN TestGlobMatch/src/foo.py_src/foo.py
=== RUN TestGlobMatch/src/foo.py_foo.py
=== RUN TestGlobMatch/*_foo.py
=== RUN TestGlobMatch/*_.gitignore
=== RUN TestGlobMatch/*_src/foo.py
=== RUN TestGlobMatch/\*.py_*.py
=== RUN TestGlobMatch/\*.py_foo.py
=== RUN TestGlobMatch/\\*.py_\foo.py
=== RUN TestGlobMatch/\\*.py_foo.py
=== RUN TestGlobMatch/foo*bar_foobar
=== RUN TestGlobMatch/foo*bar_foo2bar
=== RUN TestGlobMatch/foo*bar_foo/bar
=== RUN TestGlobMatch/foo?.go_foo1.go
=== RUN TestGlobMatch/foo?.go_fooab.go
=== RUN TestGlobMatch/foo?.go_foo/.go
=== RUN TestGlobMatch/_
=== RUN TestGlobMatch/*_
=== RUN TestGlobMatch/?_
--- PASS: TestGlobMatch (0.00s)
--- PASS: TestGlobMatch/*.go_foo.go (0.00s)
--- PASS: TestGlobMatch/*.go_bar.go (0.00s)
--- PASS: TestGlobMatch/*.go_dir/foo.go (0.00s)
--- PASS: TestGlobMatch/*.go_.hidden.go (0.00s)
--- PASS: TestGlobMatch/src/*.py_src/foo.py (0.00s)
--- PASS: TestGlobMatch/src/*.py_src/other/foo.py (0.00s)
--- PASS: TestGlobMatch/**/*.go_foo.go (0.00s)
--- PASS: TestGlobMatch/**/*.go_dir/foo.go (0.00s)
--- PASS: TestGlobMatch/**/*.go_dir/sub/foo.go (0.00s)
--- PASS: TestGlobMatch/**/*.go_.hidden/foo.go (0.00s)
--- PASS: TestGlobMatch/**_anything (0.00s)
--- PASS: TestGlobMatch/**_dir/sub/file.txt (0.00s)
--- PASS: TestGlobMatch/src/**_src/foo.go (0.00s)
--- PASS: TestGlobMatch/src/**_src/sub/foo.go (0.00s)
--- PASS: TestGlobMatch/src/**_other/foo.go (0.00s)
--- PASS: TestGlobMatch/foo.py_foo.py (0.00s)
--- PASS: TestGlobMatch/foo.py_src/foo.py (0.00s)
--- PASS: TestGlobMatch/src/foo.py_src/foo.py (0.00s)
--- PASS: TestGlobMatch/src/foo.py_foo.py (0.00s)
--- PASS: TestGlobMatch/*_foo.py (0.00s)
--- PASS: TestGlobMatch/*_.gitignore (0.00s)
--- PASS: TestGlobMatch/*_src/foo.py (0.00s)
--- PASS: TestGlobMatch/\*.py_*.py (0.00s)
--- PASS: TestGlobMatch/\*.py_foo.py (0.00s)
--- PASS: TestGlobMatch/\\*.py_\foo.py (0.00s)
--- PASS: TestGlobMatch/\\*.py_foo.py (0.00s)
--- PASS: TestGlobMatch/foo*bar_foobar (0.00s)
--- PASS: TestGlobMatch/foo*bar_foo2bar (0.00s)
--- PASS: TestGlobMatch/foo*bar_foo/bar (0.00s)
--- PASS: TestGlobMatch/foo?.go_foo1.go (0.00s)
--- PASS: TestGlobMatch/foo?.go_fooab.go (0.00s)
--- PASS: TestGlobMatch/foo?.go_foo/.go (0.00s)
--- PASS: TestGlobMatch/_ (0.00s)
--- PASS: TestGlobMatch/*_ (0.00s)
--- PASS: TestGlobMatch/?_ (0.00s)
=== RUN TestParseReuseTOML_SingleAnnotation
--- PASS: TestParseReuseTOML_SingleAnnotation (0.00s)
=== RUN TestParseReuseTOML_MultipleAnnotations
--- PASS: TestParseReuseTOML_MultipleAnnotations (0.00s)
=== RUN TestParseReuseTOML_ArrayPaths
--- PASS: TestParseReuseTOML_ArrayPaths (0.00s)
=== RUN TestParseReuseTOML_ArrayCopyrightAndLicense
--- PASS: TestParseReuseTOML_ArrayCopyrightAndLicense (0.00s)
=== RUN TestParseReuseTOML_AllPrecedences
--- PASS: TestParseReuseTOML_AllPrecedences (0.00s)
=== RUN TestParseReuseTOML_MissingVersion
--- PASS: TestParseReuseTOML_MissingVersion (0.00s)
=== RUN TestParseReuseTOML_WrongVersion
--- PASS: TestParseReuseTOML_WrongVersion (0.00s)
=== RUN TestParseReuseTOML_InvalidTOML
--- PASS: TestParseReuseTOML_InvalidTOML (0.00s)
=== RUN TestParseReuseTOML_InvalidPrecedence
--- PASS: TestParseReuseTOML_InvalidPrecedence (0.00s)
=== RUN TestParseReuseTOML_MissingPaths
--- PASS: TestParseReuseTOML_MissingPaths (0.00s)
=== RUN TestAnnotation_Matches
--- PASS: TestAnnotation_Matches (0.00s)
=== RUN TestReuseTOML_ReuseInfoOf_LastMatchWins
--- PASS: TestReuseTOML_ReuseInfoOf_LastMatchWins (0.00s)
=== RUN TestReuseTOML_ReuseInfoOf_NoMatch
--- PASS: TestReuseTOML_ReuseInfoOf_NoMatch (0.00s)
=== RUN TestReuseTOML_ReuseInfoOf_SourceType
--- PASS: TestReuseTOML_ReuseInfoOf_SourceType (0.00s)
=== RUN TestParseReuseTOMLFile
--- PASS: TestParseReuseTOMLFile (0.00s)
PASS
ok github.com/git-pkgs/reuse/toml 1.200sAll 64 tests pass across all packages. Build, vet, and tests all clean.
Updated task #7 status
Everything is done. Here's a summary of what changed:
New files:
internal/core/core.go -- ReuseInfo, SourceType, PrecedenceType and all their constants/methodsextract/extract.go + extract/extract_test.go -- SPDX header extraction (was root extract.go)dep5/dep5.go + dep5/dep5_test.go -- dep5 parser (was root dep5.go)toml/toml.go + toml/toml_test.go -- REUSE.toml parser (was root toml.go)toml/glob.go + toml/glob_test.go -- glob matching (was root glob.go, moved here since only toml uses it)Modified files:
reuse.go -- rewritten to type aliases and constant re-exports from internal/coreproject.go -- imports extract, dep5, toml subpackages; Project struct fields now use subpackage typescovered_test.go -- added assertSlice helper (previously lived in extract_test.go)Deleted files:
extract.go, extract_test.go, dep5.go, dep5_test.go, toml.go, toml_test.go, glob.go, glob_test.go from rootUnchanged files:
covered.go, project_test.gocommit this with "Hello world"
git statusOn branch main No commits yet Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: .gitmodules new file: testdata/reuse-example Untracked files: (use "git add <file>..." to include in what will be committed) .github/ .gitignore LICENSE README.md covered.go covered_test.go dep5/ extract/ go.mod go.sum internal/ project.go project_test.go reuse.go testdata/fake_repository/ toml/
git diff --stat(empty result)
git add .github .gitignore LICENSE README.md covered.go covered_test.go dep5/ extract/ go.mod go.sum internal/ project.go project_test.go reuse.go testdata/fake_repository/ toml/(empty result)
git commit -m "$(cat <<'EOF'
Hello world
EOF
)"[main (root-commit) 15fc8b5] Hello world 34 files changed, 2920 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 LICENSE create mode 100644 README.md create mode 100644 covered.go create mode 100644 covered_test.go create mode 100644 dep5/dep5.go create mode 100644 dep5/dep5_test.go create mode 100644 extract/extract.go create mode 100644 extract/extract_test.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 internal/core/core.go create mode 100644 project.go create mode 100644 project_test.go create mode 100644 reuse.go create mode 100644 testdata/fake_repository/LICENSES/Apache-2.0.txt create mode 100644 testdata/fake_repository/LICENSES/CC0-1.0.txt create mode 100644 testdata/fake_repository/LICENSES/GPL-3.0-or-later.txt create mode 100644 testdata/fake_repository/LICENSES/MIT.txt create mode 100644 testdata/fake_repository/REUSE.toml create mode 100644 testdata/fake_repository/assets/logo.png create mode 100644 testdata/fake_repository/assets/logo.png.license create mode 100644 testdata/fake_repository/src/dual.go create mode 100644 testdata/fake_repository/src/ignore.go create mode 100644 testdata/fake_repository/src/main.go create mode 100644 testdata/fake_repository/src/noheader.go create mode 160000 testdata/reuse-example create mode 100644 toml/glob.go create mode 100644 toml/glob_test.go create mode 100644 toml/toml.go create mode 100644 toml/toml_test.go
Committed as 15fc8b5 with message "Hello world".
empty repo here: https://github.com/git-pkgs/reuse
git remote -v(empty result)
git remote add origin git@github.com:git-pkgs/reuse.git(empty result)
Ready to push to git@github.com:git-pkgs/reuse.git. This will push the main branch to the remote. Want me to go ahead?
yes
git push -u origin mainbranch 'main' set up to track 'origin/main'. To github.com:git-pkgs/reuse.git * [new branch] main -> main
Pushed to https://github.com/git-pkgs/reuse.
failing ci
gh run list --repo git-pkgs/reuse --limit 1completed success github_actions in /. - Update #1244493389 Dependabot Updates main dynamic 22041992868 27s 2026-02-15T19:51:18Z
gh run list --repo git-pkgs/reuse --limit 5completed success github_actions in /. - Update #1244493389 Dependabot Updates main dynamic 22041992868 27s 2026-02-15T19:51:18Z completed success go_modules in /. - Update #1244493387 Dependabot Updates main dynamic 22041992830 29s 2026-02-15T19:51:18Z completed success go_modules in /. - Update #1244493379 Dependabot Updates main dynamic 22041992704 23s 2026-02-15T19:51:18Z completed success github_actions in /. - Update #1244493380 Dependabot Updates main dynamic 22041992589 23s 2026-02-15T19:51:17Z completed failure Hello world CI main push 22041991817 32s 2026-02-15T19:51:14Z
gh run view 22041991817 --repo git-pkgs/reuse --log-failedlint golangci-lint 2026-02-15T19:51:21.6365808Z ##[group]Run golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20
lint golangci-lint 2026-02-15T19:51:21.6366297Z with:
lint golangci-lint 2026-02-15T19:51:21.6366505Z version: latest
lint golangci-lint 2026-02-15T19:51:21.6367023Z install-mode: binary
lint golangci-lint 2026-02-15T19:51:21.6367276Z install-only: false
lint golangci-lint 2026-02-15T19:51:21.6367706Z github-token: ***
lint golangci-lint 2026-02-15T19:51:21.6367935Z verify: true
lint golangci-lint 2026-02-15T19:51:21.6368175Z only-new-issues: false
lint golangci-lint 2026-02-15T19:51:21.6368425Z skip-cache: false
lint golangci-lint 2026-02-15T19:51:21.6368669Z skip-save-cache: false
lint golangci-lint 2026-02-15T19:51:21.6368937Z cache-invalidation-interval: 7
lint golangci-lint 2026-02-15T19:51:21.6369222Z problem-matchers: false
lint golangci-lint 2026-02-15T19:51:21.6369467Z env:
lint golangci-lint 2026-02-15T19:51:21.6369668Z GOTOOLCHAIN: local
lint golangci-lint 2026-02-15T19:51:21.6369898Z ##[endgroup]
lint golangci-lint 2026-02-15T19:51:21.7816183Z ##[group]Restore cache
lint golangci-lint 2026-02-15T19:51:21.7820840Z Checking for go.mod: go.mod
lint golangci-lint 2026-02-15T19:51:21.7827178Z (node:2493) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
lint golangci-lint 2026-02-15T19:51:21.7828743Z (Use `node --trace-deprecation ...` to show where the warning was created)
lint golangci-lint 2026-02-15T19:51:21.8879587Z Cache not found for input keys: golangci-lint.cache-Linux-2928-d2be98890326f3c470fa1cbae29099069916746a, golangci-lint.cache-Linux-2928-
lint golangci-lint 2026-02-15T19:51:21.8881142Z ##[endgroup]
lint golangci-lint 2026-02-15T19:51:21.8881770Z ##[group]Install
lint golangci-lint 2026-02-15T19:51:21.8882197Z Finding needed golangci-lint version...
lint golangci-lint 2026-02-15T19:51:21.9123048Z Requested golangci-lint 'latest', using 'v2.9.0', calculation took 24ms
lint golangci-lint 2026-02-15T19:51:21.9123817Z Installation mode: binary
lint golangci-lint 2026-02-15T19:51:21.9124286Z Installing golangci-lint binary v2.9.0...
lint golangci-lint 2026-02-15T19:51:21.9125776Z Downloading binary https://github.com/golangci/golangci-lint/releases/download/v2.9.0/golangci-lint-2.9.0-linux-amd64.tar.gz ...
lint golangci-lint 2026-02-15T19:51:22.0760186Z [command]/usr/bin/tar xz --overwrite --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/work/_temp/5f6f402e-acc2-4216-9c9d-88c18f793ed2
lint golangci-lint 2026-02-15T19:51:22.3423603Z Installed golangci-lint into /home/runner/golangci-lint-2.9.0-linux-amd64/golangci-lint in 430ms
lint golangci-lint 2026-02-15T19:51:22.3428458Z ##[endgroup]
lint golangci-lint 2026-02-15T19:51:22.3432899Z ##[group]run golangci-lint
lint golangci-lint 2026-02-15T19:51:22.3439137Z Running [/home/runner/golangci-lint-2.9.0-linux-amd64/golangci-lint config path] in [/home/runner/work/reuse/reuse] ...
lint golangci-lint 2026-02-15T19:51:22.4625858Z Running [/home/runner/golangci-lint-2.9.0-linux-amd64/golangci-lint run] in [/home/runner/work/reuse/reuse] ...
lint golangci-lint 2026-02-15T19:51:35.0207196Z ##[error]toml/glob.go:31:4: QF1003: could use tagged switch on next (staticcheck)
lint golangci-lint 2026-02-15T19:51:35.0213566Z if next == '*' {
lint golangci-lint 2026-02-15T19:51:35.0213787Z ^
lint golangci-lint 2026-02-15T19:51:35.0213955Z 1 issues:
lint golangci-lint 2026-02-15T19:51:35.0214125Z * staticcheck: 1
lint golangci-lint 2026-02-15T19:51:35.0214310Z
lint golangci-lint 2026-02-15T19:51:35.0223073Z ##[error]issues found
lint golangci-lint 2026-02-15T19:51:35.0223924Z Ran golangci-lint in 12555ms
lint golangci-lint 2026-02-15T19:51:35.0224410Z ##[endgroup]Lint failure: toml/glob.go:31 wants a tagged switch instead of if/else chain on next.
go test -race ./toml/...ok github.com/git-pkgs/reuse/toml 1.234s
Tests pass. Want me to commit and push this fix?
yes
git add toml/glob.go && git commit -m "$(cat <<'EOF'
Fix staticcheck QF1003 lint in glob.go
EOF
)" && git push[main 1fb6b84] Fix staticcheck QF1003 lint in glob.go 1 file changed, 4 insertions(+), 3 deletions(-) To github.com:git-pkgs/reuse.git 15fc8b5..1fb6b84 main -> main
Pushed as 1fb6b84.
check if ci passes now
gh run list --repo git-pkgs/reuse --limit 3 --branch mainin_progress Fix staticcheck QF1003 lint in glob.go CI main push 22042061354 14s 2026-02-15T19:56:06Z completed success github_actions in /. - Update #1244493389 Dependabot Updates main dynamic 22041992868 27s 2026-02-15T19:51:18Z completed success go_modules in /. - Update #1244493387 Dependabot Updates main dynamic 22041992830 29s 2026-02-15T19:51:18Z
Still running. Let me wait a bit.
gh run watch 22042061354 --repo git-pkgs/reuse --exit-statusRun CI (22042061354) has already completed with 'success'
CI passes.
now let's look at the dependabot PRs
gh pr list --repo git-pkgs/reuse(empty result)
No open PRs. Dependabot may have auto-merged or the updates were applied directly. Let me check if there are recently closed/merged ones.
gh pr list --repo git-pkgs/reuse --state all(empty result)
No PRs at all. The Dependabot runs we saw earlier were just the initial config checks, not actual PRs. Nothing to review.
can this tool be used in a similar way to scancode license checker?
The user is asking whether the reuse Go library we just reorganized can be used similarly to ScanCode, a license compliance tool. Let me think about what each does.
ScanCode is a tool that scans codebases to detect licenses, copyrights, and other metadata. It detects licenses by analyzing file content against a database of known license texts and patterns.
The reuse library parses REUSE spec metadata - SPDX headers, .license sidecars, REUSE.toml annotations, and dep5 files. It relies on explicit SPDX tags that authors have added, rather than detecting licenses from file content.
So they serve related but different purposes. ScanCode does detection/identification of licenses from arbitrary text. This library reads structured SPDX metadata that follows the REUSE specification. They overlap in that both tell you "what license applies to this file" but through very different mechanisms.
They solve related problems but work differently.
ScanCode scans file contents and matches them against a database of known license texts. It can identify a license even when there are no SPDX tags, by recognizing patterns in license headers, notices, and full license texts. It's detection-based.
This library reads structured SPDX metadata that authors have explicitly added following the REUSE spec: SPDX-License-Identifier headers, .license sidecars, REUSE.toml annotations, and dep5 files. It doesn't try to identify licenses from arbitrary text. If a file has no SPDX tags and isn't covered by a REUSE.toml or dep5 entry, this library just reports it as having no licensing info.
So ScanCode works on projects that haven't adopted any particular standard. This library works on projects that follow the REUSE specification. In a REUSE-compliant project, every covered file has explicit SPDX metadata, and this library is all you need. For projects without that discipline, you'd want something like ScanCode.
They could complement each other: use ScanCode to audit a project that lacks structured metadata, then use the results to add REUSE-compliant tags, then use this library going forward.
Implement the following plan:
Currently all code lives in one flat reuse package. Move parsers into public subpackages, matching the internal/core + type alias pattern used by manifests and registries.
Root package (project.go) imports subpackages. Subpackages need ReuseInfo, SourceType, PrecedenceType from root. That's a cycle.
Fix: move shared types to internal/core. Root re-exports them as type aliases (type ReuseInfo = core.ReuseInfo). Subpackages import internal/core directly. No cycles.
reuse/
reuse.go type aliases from internal/core, package docs
project.go Project, OpenProject, ReuseInfoOf, AllReuseInfo
project_test.go
covered.go IsCoveredFile, CoveredFiles, IsIgnoredDir, IsIgnoredFile
covered_test.go
internal/
core/
core.go ReuseInfo, SourceType, PrecedenceType (actual definitions + methods)
extract/
extract.go ExtractReuseInfo, ExtractFromFile, FilterIgnoreBlocks
extract_test.go
dep5/
dep5.go Dep5, ParseDep5, ParseDep5File, ReuseInfoOf
dep5_test.go
toml/
toml.go ReuseTOML, Annotation, ParseReuseTOML, ParseReuseTOMLFile, ReuseInfoOf
toml_test.go
glob.go GlobMatch (only used by toml, stays here)
glob_test.go
reuse.go types/constants/methods -> internal/core/core.goreuse.go becomes type aliases + package docextract.go + test -> extract/ subpackage, package extract, imports internal/coredep5.go + test -> dep5/ subpackage, package dep5, imports internal/coretoml.go + test -> toml/ subpackage, package toml, imports internal/core and uses alias for BurntSushi/toml (btoml)glob.go + test -> toml/ subpackage (glob is only used by toml matching)covered.go + test -> stays in root (no deps on subpackages, no cycle risk)project.go + test -> stays in root, imports extract, dep5, toml subpackagesConsumer usage:
reuse.gopackage coretype ReuseInfo = core.ReuseInfo, type SourceType = core.SourceType, etc.const (FileHeader = core.FileHeader; ...)package reuse -> package extractgithub.com/git-pkgs/reuse/internal/coreReuseInfo with core.ReuseInfo, FileHeader with core.FileHeaderpackage reuse -> package dep5github.com/git-pkgs/reuse/internal/corepackage reuse -> package tomlbtoml "github.com/BurntSushi/toml" (alias to avoid name conflict with package name)github.com/git-pkgs/reuse/internal/corepackage reuse -> package tomlextract, dep5, toml subpackagesExtractFromFile -> extract.ExtractFromFile, etc.ParseReuseTOMLFile -> toml.ParseReuseTOMLFileParseDep5File -> dep5.ParseDep5FileReuseInfo etc. since root re-exports themassertSlice helper is duplicated into each test package (or made a shared test helper)mkfile helper stays in root test (project_test.go, covered_test.go)extract_test.go and dep5_test.go each get their own assertSlicego build ./...go test -v -race ./...go vet ./...If you need specific details from before exiting plan mode (like exact code snippets, error messages, or content you generated), read the full transcript at: /Users/andrew/.claude/projects/-Users-andrew-code-git-pkgs/e29c14b3-41b4-4a33-a3ba-dc32811240a3.jsonl
Now let me read all the test files.
Let me start by understanding the current codebase structure and reading the key files before making changes.
Now I have a clear picture of all the code. Let me create the task list and start implementing. I'll need to:
Create internal/core/core.go with the types/constants/methods from reuse.go
Rewrite reuse.go as type aliases
Create extract/extract.go from extract.go
Create extract/extract_test.go from extract_test.go
Create dep5/dep5.go from dep5.go
Create dep5/dep5_test.go from dep5_test.go
Create the TOML package files from the existing TOML code
Update project.go to import from the new subpackages
Handle the test helper functions like assertSlice and mkfile that are scattered across test files - I'll need to consolidate these or make them available where they're needed after the reorganization
Delete the original files from the root directory
Actually, I need to be more careful here. The test helpers are currently defined in different test files but used across multiple tests. When I move the test files to their subpackages, each one will need access to these helpers, so I should either duplicate them in each test file or create a shared test utilities file within each package.
Looking at the dependencies: covered_test.go defines mkfile and uses assertSlice, while project_test.go uses both helpers. After moving files around, the root package will still have project_test.go and covered_test.go, so they'll need access to both helpers. I could keep them in covered_test.go where mkfile is already defined, or extract them to a separate test helper file in the root package. covered_test.goand addassertSlicethere too (sinceextract_test.go` which currently defines it is moving away).
Actually, wait. Let me look at what dep5_test uses. It uses assertSlice (line 37, 63, 85) which is currently defined in extract_test.go. And toml_test uses assertSlice too.
So I need to distribute assertSlice to each test file that needs it: covered_test.go for the root package tests, then separate copies in extract_test.go, dep5_test.go, and toml_test.go. I should also check what other types and functions each test file references to make sure nothing breaks after the move. In dep5_test.go there's Dep5Source, and in toml_test.go there are references to Closest, Override, Aggregate, PrecedenceType, ReuseToml, and GlobMatch that I need to verify are properly accessible. I need to account for the fact that Annotation has a Precedence field of type core.PrecedenceType, so when the tests compare it against constants like Closest or Override, they'll need to use the core. prefix since those are now in the core package.
Now I'm mapping out the package structure and import strategy: internal/core/core.go will hold all the core types and constants, reuse.go will re-export them as type aliases for the public API, and the extract and toml packages will import directly from internal/core to access what they need. I'm seeing that the toml package import in project.go will create a naming conflict with the ReuseToml type, so I need to alias the import to avoid that collision. So after the reorganization, the Project struct in the root package would reference *toml.ReuseTOML and *dep5.Dep5 from their respective subpackages. That means consumers would need to import all three packages to work with Project fields, which follows the plan but is a bit verbose. Finishing the struct definition, the Project type will have fields referencing the subpackage types like *toml.ReuseTOML and *dep5.Dep5. For the test files in those subpackages, they'll need to import core to access the constants they reference, which is fine since internal/core is accessible to other packages under internal/.
Now I'm planning out the file creation order: starting with the core types, then rewriting the main reuse module, building out each subpackage with its tests, and finally updating the existing project and test files.
For the core module, I'll move the current reuse.go content there. Then in reuse.go, I need to set up type aliases and re-export the constants from the core package so the public API stays the same.
Setting up type aliases and constant re-exports... The type alias works out because SourceType points to core.SourceType, so assigning core.FileHeader to each constant gives them the right type. Now I need to figure out what happens with project_test.go — it's using helper functions like assertSlice, mkfile, writeReuseTOML, and setupFakeProject that were scattered across different test files, and I need to track where each one ends up after the refactor. I need to duplicate assertSlice into each test package rather than sharing it, so for the root package I'll add it to covered_test.go since that file is staying put.
Looking at which files actually use assertSlice, I see toml_test.go needs its own copy too, while glob_test.go doesn't use it at all. Now I'm going through each subpackage test file to figure out what imports and helper functions each one needs, starting with extract_test.go which creates ReuseInfo objects through the public API functions. to be defined locally. For the TOML test file, I need to handle the same pattern—ParseReuseTOML and related functions stay in package, but PrecedenceType, Closest, Override, Aggregate, and ReuseToml all need the core. prefix, and assertSlice needs a local definition. The glob test file is simpler since GlobMatch is already in the same package with no other external dependencies.
Now looking at project_test.go, it depends on root-level functions like OpenProject and methods like ReuseInfoOf and AllReuseInfo on the *Project type, plus assertSlice which should live in the root test package. The helper functions setupFakeProject and writeReuseTOML are defined within that file, and DotLicense and ReuseInfo get re-exported from the root package. The test indirectly uses ParseReuseTOMLFile through OpenProject, and directly calls methods like p.ReuseTOML on the project instance.
After moving things around, p.ReuseTOML becomes a *toml.ReuseTOML type, but the test only does nil checks on it, which should work fine without needing to import the subpackage since we're just comparing against nil.
Let me start implementing this now.
Actually, I should double-check one more thing: the project.go file calls p.ReuseTOML.ReuseInfoOf(path) and p.Dep5.ReuseInfoOf(path), both of which return types that are aliased in the root package, so they'll work seamlessly with the existing code.
Now I need to plan out the refactoring carefully to avoid Go compilation errors from duplicate symbols. I'll create the new package directories and files first, then update the existing root files to import from those packages, and finally remove the old files that have been moved.
I have a clear picture of the full codebase. Let me create the task list and then implement everything. The key challenge is that Go won't compile with duplicate symbols, so I need to swap old files for new ones atomically.
I'll start by reading the current files to understand the exact code before making changes.
Task #1 created successfully: Create internal/core/core.go with shared types
Task #2 created successfully: Rewrite reuse.go as type aliases and constant re-exports
Task #3 created successfully: Create extract/ subpackage from extract.go
Task #4 created successfully: Create dep5/ subpackage from dep5.go
Task #5 created successfully: Create toml/ subpackage from toml.go and glob.go
Task #6 created successfully: Update project.go to use subpackage imports
Task #7 created successfully: Update root test files and delete old source files
Updated task #1 status
mkdir -p /Users/andrew/code/git-pkgs/reuse/internal/core /Users/andrew/code/git-pkgs/reuse/extract /Users/andrew/code/git-pkgs/reuse/dep5 /Users/andrew/code/git-pkgs/reuse/toml(empty result)
ls -la /Users/andrew/code/git-pkgs/reuse/total 216 drwxr-xr-x 24 andrew staff 768 15 Feb 19:23 . drwxr-xr-x 30 andrew staff 960 15 Feb 18:52 .. drwxr-xr-x 12 andrew staff 384 15 Feb 19:24 .git drwxr-xr-x 4 andrew staff 128 15 Feb 19:22 .github -rw-r--r-- 1 andrew staff 14 15 Feb 19:09 .gitignore -rw-r--r-- 1 andrew staff 117 15 Feb 19:19 .gitmodules -rw-r--r-- 1 andrew staff 3387 15 Feb 19:14 covered_test.go -rw-r--r-- 1 andrew staff 2776 15 Feb 19:14 covered.go -rw-r--r-- 1 andrew staff 5861 15 Feb 19:13 dep5_test.go -rw-r--r-- 1 andrew staff 5316 15 Feb 19:23 dep5.go -rw-r--r-- 1 andrew staff 7969 15 Feb 19:12 extract_test.go -rw-r--r-- 1 andrew staff 4715 15 Feb 19:11 extract.go -rw-r--r-- 1 andrew staff 1887 15 Feb 19:10 glob_test.go -rw-r--r-- 1 andrew staff 1407 15 Feb 19:10 glob.go -rw-r--r-- 1 andrew staff 87 15 Feb 19:14 go.mod -rw-r--r-- 1 andrew staff 171 15 Feb 19:14 go.sum -rw-r--r-- 1 andrew staff 1071 15 Feb 19:09 LICENSE -rw-r--r-- 1 andrew staff 10573 15 Feb 19:22 project_test.go -rw-r--r-- 1 andrew staff 5040 15 Feb 19:15 project.go -rw-r--r-- 1 andrew staff 1751 15 Feb 19:22 README.md -rw-r--r-- 1 andrew staff 2380 15 Feb 19:10 reuse.go drwxr-xr-x 4 andrew staff 128 15 Feb 19:21 testdata -rw-r--r-- 1 andrew staff 7124 15 Feb 19:14 toml_test.go -rw-r--r-- 1 andrew staff 3726 15 Feb 19:13 toml.go
Updated task #1 status
Updated task #2 status
Updated task #2 status
Updated task #3 status
Updated task #3 status
Updated task #4 status
Updated task #4 status
Updated task #5 status
Good, the diagnostic is just from the file being created in stages. Now the toml test files:
Updated task #5 status
Updated task #6 status
Now update project.go to import the subpackages: