{"id":44532310,"url":"https://github.com/the/purepkg","last_synced_at":"2026-02-13T18:39:05.548Z","repository":{"id":228968779,"uuid":"333977363","full_name":"the/purepkg","owner":"the","description":"Verify that only allowed Go packages are imported","archived":false,"fork":false,"pushed_at":"2021-10-12T07:54:24.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T06:11:49.383Z","etag":null,"topics":["cli","go","golang","static-check"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/the.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-28T22:53:00.000Z","updated_at":"2023-02-17T00:40:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0bb1aa7-1fd3-4819-a538-cc4011cab379","html_url":"https://github.com/the/purepkg","commit_stats":null,"previous_names":["the/purepkg"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/the/purepkg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the%2Fpurepkg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the%2Fpurepkg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the%2Fpurepkg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the%2Fpurepkg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/the","download_url":"https://codeload.github.com/the/purepkg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/the%2Fpurepkg/sbom","scorecard":{"id":877341,"data":{"date":"2025-08-11","repo":{"name":"github.com/the/purepkg","commit":"9481a03a9b8d4d6fbd3ec05f80b75dd3e1ec45f1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/3 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T06:33:34.509Z","repository_id":228968779,"created_at":"2025-08-24T06:33:34.509Z","updated_at":"2025-08-24T06:33:34.509Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29414282,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","go","golang","static-check"],"created_at":"2026-02-13T18:39:04.715Z","updated_at":"2026-02-13T18:39:05.529Z","avatar_url":"https://github.com/the.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# purepkg - pure packages\n\nWhen developing in Go it can be desirable at times to limit the imports in a package. For reasons like:\n* Avoid the likelihood of future circular dependencies when you have a certain package structure in mind.\n* Having the intention to move the package to its own repository later as an independent library.\n* Enforcement of a certain package architecture.\n* Prevent accidently importing the wrong package: think of `math/rand` instead of `crypto/rand` in cryptographic code.\n* Caring about the purity of a package, eg. only using the standard library.\n\n`purepkg` can help to achieve that by verifying that only allowed packages are imported.\n\n## Installation\n\nYou can install `purepkg` directly from the `main` branch with `go install github.com/the/purepkg`. Or run it directly by invoking `go run github.com/the/purepkg`.\n\n## Usage\n\n```\npurepkg [-v] [-stdlib] [-notest] [-allow pkg1,pkg2,...] \u003cpackage\u003e\n\nOptions:\n  -allow packages\n    \tcomma separated list of allowed packages\n  -notest\n    \tignore tests\n  -stdlib\n    \tinclude all standard library packages\n  -v    verbose output\n```\n\nWhen no unallowed package is found `purepkg` exits with exit code `0`. Otherwise it will exit with `2` which can be useful to abort a build process or checks executed in a CI/CD pipeline. By default test code is included. Adding the `-notest` argument ignores the tests.\n\n## Examples\n\n```\n$ purepkg -stdlib github.com/the/purepkg\n\npackage github.com/the/purepkg\n  ✗ import golang.org/x/tools/go/packages\n```\n\n```\n$ purepkg -v -stdlib -allow \"golang.org/*\" github.com/the/purepkg\n\npackage github.com/the/purepkg\n  ✔ import log\n  ✔ import os\n  ✔ import strings\n  ✔ import flag\n  ✔ import fmt\n  ✔ import golang.org/x/tools/go/packages\n```\n\n```\n$ purepkg -v -stdlib -allow \"golang.org/x/text*\" golang.org/x/text/language/...\n\npackage golang.org/x/text/language\n  ✔ import sort\n  ✔ import strconv\n  ✔ import strings\n  ✔ import errors\n  ✔ import fmt\n  ✔ import golang.org/x/text/internal/language\n  ✔ import golang.org/x/text/internal/language/compact\npackage golang.org/x/text/language/display\n  ✔ import sort\n  ✔ import strings\n  ✔ import fmt\n  ✔ import golang.org/x/text/internal/format\n  ✔ import golang.org/x/text/language\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe%2Fpurepkg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthe%2Fpurepkg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthe%2Fpurepkg/lists"}