{"id":26235604,"url":"https://github.com/onexstack/addlicense","last_synced_at":"2025-09-08T19:38:01.440Z","repository":{"id":217866968,"uuid":"744986281","full_name":"onexstack/addlicense","owner":"onexstack","description":"A program which ensures source code files have copyright license headers by scanning directory patterns recursively","archived":false,"fork":false,"pushed_at":"2025-08-24T02:07:28.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-25T11:52:45.568Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onexstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-18T12:12:47.000Z","updated_at":"2024-11-27T01:34:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2a37d0a-4e7c-47e9-acc1-260879446d7f","html_url":"https://github.com/onexstack/addlicense","commit_stats":null,"previous_names":["superproj/addlicense","onexstack/addlicense"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/onexstack/addlicense","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onexstack%2Faddlicense","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onexstack%2Faddlicense/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onexstack%2Faddlicense/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onexstack%2Faddlicense/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onexstack","download_url":"https://codeload.github.com/onexstack/addlicense/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onexstack%2Faddlicense/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231436,"owners_count":25245585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-03-13T03:16:40.479Z","updated_at":"2025-09-08T19:38:01.389Z","avatar_url":"https://github.com/onexstack.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 授权头检查和添加工具\n\n\n## 安装\n\n```bash\n$ go get -u github.com/superproj/addlicense\n```\n\n帮助信息为：\n\n```bash\n$ addlicense -h\nUsage: addlicense [flags] pattern [pattern ...]\n\nThe program ensures source code files have copyright license headers\nby scanning directory patterns recursively.\n\nIt modifies all source files in place and avoids adding a license header\nto any file that already has one.\n\nThe pattern argument can be provided multiple times, and may also refer\nto single files.\n\nFlags:\n\n      --check                check only mode: verify presence of license headers and exit with non-zero code if missing\n  -h, --help                 show this help message\n  -c, --holder string        copyright holder (default \"Google LLC\")\n  -l, --license string       license type: apache, bsd, mit, mpl (default \"apache\")\n  -f, --licensef string      custom license file (no default)\n      --skip-dirs strings    regexps of directories to skip\n      --skip-files strings   regexps of files to skip\n  -v, --verbose              verbose mode: print the name of the files that are modified\n  -y, --year string          copyright year(s) (default \"2021\")\n```\n\n参数说明：\n\n- `--check` 只检查\n- `-f, --licensef` 指定版权头文件\n- `-v` 打印被更改的文件\n- `--skip-dirs` 跳过指定的文件夹\n\n## 使用方法\n\n1. 创建版权头文件\n\n```bash\n$ cat ./boilerplate.txt\nCopyright 2020 Lingfei Kong \u003ccolin404@foxmail.com\u003e. All rights reserved.\nUse of this source code is governed by a MIT style\nlicense that can be found in the LICENSE file.\n```\n\n2. 检查文件中是否都有该版权头\n\n```bash\n$ addlicense --check -f ./boilerplate.txt . --skip-dirs=third_party\n```\n\n3. 给缺失版权头的文件添加版权头\n\n```bash\n$ addlicense -v -f ./boilerplate.txt . --skip-dirs=third_party\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonexstack%2Faddlicense","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonexstack%2Faddlicense","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonexstack%2Faddlicense/lists"}