{"id":13646808,"url":"https://github.com/apache/skywalking-eyes","last_synced_at":"2025-05-14T22:09:05.132Z","repository":{"id":37023577,"uuid":"323231688","full_name":"apache/skywalking-eyes","owner":"apache","description":"A full-featured license tool to check and fix license headers and resolve dependencies' licenses.","archived":false,"fork":false,"pushed_at":"2025-04-24T02:05:46.000Z","size":1405,"stargazers_count":272,"open_issues_count":0,"forks_count":59,"subscribers_count":38,"default_branch":"main","last_synced_at":"2025-04-29T19:27:43.959Z","etag":null,"topics":["cli","license","licensing","tools"],"latest_commit_sha":null,"homepage":"https://skywalking.apache.org/","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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}},"created_at":"2020-12-21T04:38:31.000Z","updated_at":"2025-04-24T02:05:47.000Z","dependencies_parsed_at":"2024-01-14T10:10:50.970Z","dependency_job_id":"af086c6d-7d5a-4b88-970d-5650cb64d063","html_url":"https://github.com/apache/skywalking-eyes","commit_stats":{"total_commits":203,"total_committers":43,"mean_commits":4.72093023255814,"dds":0.4926108374384236,"last_synced_commit":"3ea9df11bb3a5a85665377d1fd10c02edecf2c40"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fskywalking-eyes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fskywalking-eyes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fskywalking-eyes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fskywalking-eyes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/skywalking-eyes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251644828,"owners_count":21620630,"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","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","license","licensing","tools"],"created_at":"2024-08-02T01:03:07.869Z","updated_at":"2025-05-14T22:09:05.062Z","avatar_url":"https://github.com/apache.png","language":"Go","funding_links":[],"categories":["Go","cli"],"sub_categories":[],"readme":"# SkyWalking Eyes\n\n\u003cimg src=\"http://skywalking.apache.org/assets/logo.svg\" alt=\"Sky Walking logo\" height=\"90px\" align=\"right\" /\u003e\n\nA full-featured license tool to check and fix license headers and resolve dependencies' licenses.\n\n[![X Follow](https://img.shields.io/badge/2K%2B-follow?style=for-the-badge\u0026logo=X\u0026label=%40ASFSKYWALKING)](https://twitter.com/AsfSkyWalking)\n\n## Usage\n\nYou can use License-Eye in GitHub Actions or in your local machine.\n\n### GitHub Actions\n\nFirst of all, add a `.licenserc.yaml` in the root of your project, for Apache Software Foundation projects, the following configuration should be enough.\n\n\u003e **Note**: The full configurations can be found in [the configuration section](#configurations).\n\n```yaml\nheader:\n  license:\n    spdx-id: Apache-2.0\n    copyright-owner: Apache Software Foundation\n\n  paths-ignore:\n    - 'dist'\n    - 'licenses'\n    - '**/*.md'\n    - 'LICENSE'\n    - 'NOTICE'\n\n  comment: on-failure\n\n# If you don't want to check dependencies' license compatibility, remove the following part\ndependency:\n  files:\n    - pom.xml           # If this is a maven project.\n    - Cargo.toml        # If this is a rust project.\n    - package.json      # If this is a npm project.\n    - go.mod            # If this is a Go project.\n```\n\n#### Check License Headers\n\nTo check license headers in GitHub Actions, add a step in your GitHub workflow.\n\n```yaml\n- name: Check License Header\n  uses: apache/skywalking-eyes/header@main      # always prefer to use a revision instead of `main`.\n  # with:\n      # log: debug # optional: set the log level. The default value is `info`.\n      # config: .licenserc.yaml # optional: set the config file. The default value is `.licenserc.yaml`.\n      # token: # optional: the token that license eye uses when it needs to comment on the pull request. Set to empty (\"\") to disable commenting on pull request. The default value is ${{ github.token }}\n      # mode: # optional: Which mode License-Eye should be run in. Choices are `check` or `fix`. The default value is `check`.\n```\n\n#### Fix License Headers\n\nBy default the action runs License-Eye in check mode, which will raise an error\nif any of the processed files are missing license headers. If `mode` is set to\n`fix`, the action will instead apply the license header to any processed file\nthat is missing a license header. The fixed files can then be pushed back to the\npull request using another GitHub action. For example:\n\n```yaml\n- name: Fix License Header\n  uses: apache/skywalking-eyes/header@main\n  with:\n    mode: fix\n- name: Apply Changes\n  uses: EndBug/add-and-commit@v4\n  env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n  with:\n    author_name: License Bot\n    author_email: license_bot@github.com\n    message: 'Automatic application of license header'\n```\n\n\u003e **Warning**: The exit code of fix mode is always 0 and can not be used to block CI\nstatus. Consider running the action in check mode if you would like CI to fail\nwhen a file is missing a license header.\n\n\u003e **Note**: In 0.3.0 and earlier versions, GitHub Actions `apache/skywalking-eyes`\n\u003e only works for header check/fix, since 0.4.0, we have a dedicate GitHub Actions\n\u003e `apache/skywalking-eyes/header` for header check/fix and a GitHub Actions\n\u003e `apache/skywalking-eyes/dependency` for dependency resolve/check.\n\u003e Now `apache/skywalking-eyes` is equivalent to `apache/skywalking-eyes/header` in\n\u003e order not to break existing usages of `apache/skywalking-eyes`.\n\n#### Check Dependencies' License\n\nTo check dependencies license in GitHub Actions, add a step in your GitHub workflow.\n\n```yaml\n- name: Check Dependencies' License\n  uses: apache/skywalking-eyes/dependency@main      # always prefer to use a revision instead of `main`.\n  # with:\n      # log: debug # optional: set the log level. The default value is `info`.\n      # config: .licenserc.yaml # optional: set the config file. The default value is `.licenserc.yaml`.\n      # mode: # optional: Which mode License-Eye should be run in. Choices are `check` or `resolve`. The default value is `check`.\n      # flags: # optional: Extra flags appended to the command, for example, `--summary=path/to/template.tmpl`\n```\n\n### Docker Image\n\nFor Bash, users can execute the following command,\n\n```shell\ndocker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header check\ndocker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix\n```\n\nFor PowerShell 7, users can execute the following command,\n\n```\ndocker run -it --rm -v ${pwd}:/github/workspace apache/skywalking-eyes header check\ndocker run -it --rm -v ${pwd}:/github/workspace apache/skywalking-eyes header fix\n```\n\n#### Using Docker for License Dependency Checks\n\nTo check dependencies' licenses in Docker, you'll need the appropriate language runtime and package managers in your environment. The base Docker image only includes the license-eye binary. To check dependencies, you can build a custom Docker image with your required language tools:\n\n```dockerfile\nFROM apache/skywalking-eyes:latest\n\n# Install the tools you need\n```\n\nSee the [examples directory](examples/) for more detailed examples and Dockerfiles for different languages.\n\n### Docker Image from the latest codes\n\nFor users and developers who want to help to test the latest codes on main branch, we publish a Docker image to the GitHub\nContainer Registry for every commit in main branch, tagged with the commit sha. If it's the latest commit in main\nbranch, it's also tagged with `latest`.\n\n**Note**: these Docker images are not official Apache releases. For official releases, please refer to\n[the download page](https://skywalking.apache.org/downloads/#SkyWalkingEyes) for executable binary and\n[the Docker hub](https://hub.docker.com/r/apache/skywalking-eyes) for Docker images.\n\n```shell\ndocker run -it --rm -v $(pwd):/github/workspace ghcr.io/apache/skywalking-eyes/license-eye header check\ndocker run -it --rm -v $(pwd):/github/workspace ghcr.io/apache/skywalking-eyes/license-eye header fix\n```\n\n### Compile from Source\n\n```bash\ngit clone https://github.com/apache/skywalking-eyes\ncd skywalking-eyes\nmake build\n```\n\nNotes: The `make build` command will generate a bin directory in the current project directory. Choose the appropriate binary file according to your operating system.\n\nIf you have the Go SDK installed, you can also use the `go install` command to install the latest code.\n\n```bash\ngo install github.com/apache/skywalking-eyes/cmd/license-eye@latest\n```\n\n### Use Homebrew on macOS\n\nIf you don’t have it installed, you can install it by running the following command in terminal:\n\n```bash\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n```\n\nThen install license-eye using the following command:\n\n```bash\nbrew install license-eye\n```\n\n#### Check License Header\n\n```bash\nlicense-eye -c test/testdata/.licenserc_for_test_check.yaml header check\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eHeader Check Result\u003c/summary\u003e\n\n```\nINFO Loading configuration from file: test/testdata/.licenserc_for_test_check.yaml\nINFO Totally checked 30 files, valid: 12, invalid: 12, ignored: 6, fixed: 0\nERROR the following files don't have a valid license header:\ntest/testdata/include_test/without_license/testcase.go\ntest/testdata/include_test/without_license/testcase.graphql\ntest/testdata/include_test/without_license/testcase.ini\ntest/testdata/include_test/without_license/testcase.java\ntest/testdata/include_test/without_license/testcase.md\ntest/testdata/include_test/without_license/testcase.php\ntest/testdata/include_test/without_license/testcase.py\ntest/testdata/include_test/without_license/testcase.sh\ntest/testdata/include_test/without_license/testcase.yaml\ntest/testdata/include_test/without_license/testcase.yml\ntest/testdata/test-spdx-asf.yaml\ntest/testdata/test-spdx.yaml\nexit status 1\n```\n\n\u003c/details\u003e\n\n#### Fix License Header\n\n```bash\nlicense-eye -c test/testdata/.licenserc_for_test_fix.yaml header fix\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eHeader Fix Result\u003c/summary\u003e\n\n```\nINFO Loading configuration from file: test/testdata/.licenserc_for_test_fix.yaml\nINFO Totally checked 20 files, valid: 10, invalid: 10, ignored: 0, fixed: 10\n```\n\n\u003c/details\u003e\n\n#### Resolve Dependencies' licenses\n\nThis command assists human audits of the dependencies licenses. It's exit code is always 0.\n\nIt supports two flags:\n\n| Flag name   | Short name | Description                                                                                                                            |\n|-------------|------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| `--output`  | `-o`       | Save the dependencies' `LICENSE` files to a specified directory so that you can put them in distribution package if needed.            |\n| `--summary` | `-s`       | Based on the template, aggregate all dependency information and generate a `LICENSE` file.                                             |\n| `--license` | `-l`       | The output path to the LICENSE file to be generated. The default summary format will be used if summary template file is not specified |\n\n```bash\nlicense-eye -c test/testdata/.licenserc_for_test_check.yaml dep resolve -o ./dependencies/licenses -s LICENSE.tpl\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eDependency Resolve Result\u003c/summary\u003e\n\n```\nINFO Loading configuration from file: .licenserc.yaml\nWARNING Failed to resolve the license of \u003cgithub.com/acomagu/bufpipe@v1.0.3\u003e: cannot find license file\nDependency                           |              License |                                  Version\n------------------------------------ | -------------------- | ----------------------------------------\ngithub.com/Masterminds/goutils       |           Apache-2.0 |                                   v1.1.1\ngithub.com/Masterminds/semver/v3     |                  MIT |                                   v3.1.1\ngithub.com/Masterminds/sprig/v3      |                  MIT |                                   v3.2.2\ngithub.com/Microsoft/go-winio        |                  MIT |                                   v0.5.2\ngithub.com/ProtonMail/go-crypto      |         BSD-3-Clause |       v0.0.0-20220824120805-4b6e5c587895\ngithub.com/bmatcuk/doublestar/v2     |                  MIT |                                   v2.0.4\ngithub.com/cloudflare/circl          |         BSD-3-Clause |                                   v1.2.0\ngithub.com/davecgh/go-spew           |                  ISC |                                   v1.1.1\ngithub.com/emirpasic/gods            | BSD-2-Clause and ISC |                                  v1.18.1\ngithub.com/go-git/gcfg               |         BSD-3-Clause |                                   v1.5.0\ngithub.com/go-git/go-billy/v5        |           Apache-2.0 |                                   v5.3.1\ngithub.com/go-git/go-git/v5          |           Apache-2.0 |                                   v5.4.2\ngithub.com/golang/protobuf           |         BSD-3-Clause |                                   v1.5.2\ngithub.com/google/go-github/v33      |         BSD-3-Clause |                                  v33.0.0\ngithub.com/google/go-querystring     |         BSD-3-Clause |                                   v1.1.0\ngithub.com/google/licensecheck       |         BSD-3-Clause |                                   v0.3.1\ngithub.com/google/uuid               |         BSD-3-Clause |                                   v1.1.1\ngithub.com/huandu/xstrings           |                  MIT |                                   v1.3.1\ngithub.com/imdario/mergo             |         BSD-3-Clause |                                  v0.3.13\ngithub.com/inconshreveable/mousetrap |           Apache-2.0 |                                   v1.0.0\ngithub.com/jbenet/go-context         |                  MIT |       v0.0.0-20150711004518-d14ea06fba99\ngithub.com/kevinburke/ssh_config     |                  MIT |                                   v1.2.0\ngithub.com/mitchellh/copystructure   |                  MIT |                                   v1.0.0\ngithub.com/mitchellh/go-homedir      |                  MIT |                                   v1.1.0\ngithub.com/mitchellh/reflectwalk     |                  MIT |                                   v1.0.0\ngithub.com/pmezard/go-difflib        |         BSD-3-Clause |                                   v1.0.0\ngithub.com/sergi/go-diff             |                  MIT |                                   v1.2.0\ngithub.com/shopspring/decimal        |                  MIT |                                   v1.2.0\ngithub.com/sirupsen/logrus           |                  MIT |                                   v1.8.1\ngithub.com/spf13/cast                |                  MIT |                                   v1.3.1\ngithub.com/spf13/cobra               |           Apache-2.0 |                                   v1.4.0\ngithub.com/spf13/pflag               |         BSD-3-Clause |                                   v1.0.5\ngithub.com/stretchr/testify          |                  MIT |                                   v1.7.0\ngithub.com/xanzy/ssh-agent           |           Apache-2.0 |                                   v0.3.2\ngolang.org/x/crypto                  |         BSD-3-Clause |       v0.0.0-20220829220503-c86fa9a7ed90\ngolang.org/x/mod                     |         BSD-3-Clause | v0.6.0-dev.0.20220106191415-9b9b3d81d5e3\ngolang.org/x/net                     |         BSD-3-Clause |       v0.0.0-20220826154423-83b083e8dc8b\ngolang.org/x/oauth2                  |         BSD-3-Clause |       v0.0.0-20220411215720-9780585627b5\ngolang.org/x/sys                     |         BSD-3-Clause |       v0.0.0-20220829200755-d48e67d00261\ngolang.org/x/text                    |         BSD-3-Clause |                                   v0.3.7\ngolang.org/x/tools                   |         BSD-3-Clause |                                  v0.1.10\ngolang.org/x/xerrors                 |         BSD-3-Clause |       v0.0.0-20220517211312-f3a8303e98df\ngoogle.golang.org/appengine          |           Apache-2.0 |                                   v1.6.7\ngoogle.golang.org/protobuf           |         BSD-3-Clause |                                  v1.28.0\ngopkg.in/warnings.v0                 |         BSD-2-Clause |                                   v0.1.2\ngopkg.in/yaml.v3                     |   MIT and Apache-2.0 |                                   v3.0.0\ngithub.com/acomagu/bufpipe           |              Unknown |                                   v1.0.3\n\nERROR failed to identify the licenses of following packages (1):\ngithub.com/acomagu/bufpipe\nexit status 1\n```\n\n\u003c/details\u003e\n\n##### Summary Template\n\nThe summary is a template to generate the summary of dependencies' licenses based on the [Golang Template](https://pkg.go.dev/text/template). It includes these variables:\n\n|Name|Type|Example|Description|\n|----|----|-------|-----------|\n|LicenseContent|string|`{{.LicenseContent}}`|The project license content, it's the license of `header.license.spdx-id` (if set), otherwise it's the `header.license.content`. |\n|Groups|list structure|`{{ range .Groups }}`|The dependency groups, all licenses are grouped by the same license [SPDX ID](https://spdx.org/licenses/). |\n|Groups.LicenseID|string|`{{.LicenseID}}`|The [SPDX ID](https://spdx.org/licenses/) of dependency. |\n|Groups.Deps|list structure|`{{ range .Deps }}`|All dependencies with the same [SPDX ID](https://spdx.org/licenses/). |\n|Groups.Deps.Name|string|`{{.Name}}`|The name of the dependency. |\n|Groups.Deps.Version|string|`{{.Version}}`|The version of the dependency. |\n|Groups.Deps.LicenseID|string|`{{.LicenseID}}`|The [SPDX ID](https://spdx.org/licenses/) of the dependency license. |\n\n\u003cdetails\u003e\n\u003csummary\u003eSummary Template Generate\u003c/summary\u003e\n\nSummary template content:\n```\n{{.LicenseContent }}\n{{ range .Groups }}\n========================================================================\n{{.LicenseID}} licenses\n========================================================================\n{{range .Deps}}\n    {{.Name}} {{.Version}} {{.LicenseID}}\n{{- end }}\n{{ end }}\n```\n\nGenerate LICENSE file content:\n```\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n\n========================================================================\nMIT licenses\n========================================================================\n\n    github.com/BurntSushi/toml v0.3.1 MIT\n    github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf MIT\n    github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e MIT\n    github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da MIT\n    github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 MIT\n    github.com/beorn7/perks v1.0.0 MIT\n    github.com/bgentry/speakeasy v0.1.0 MIT\n    github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c MIT\n    github.com/bmatcuk/doublestar/v2 v2.0.4 MIT\n\n========================================================================\nISC licenses\n========================================================================\n\n    github.com/davecgh/go-spew v1.1.1 ISC\n\n========================================================================\nBSD-2-Clause licenses\n========================================================================\n\n    github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 BSD-2-Clause\n    github.com/gorilla/websocket v1.4.2 BSD-2-Clause\n    github.com/pkg/errors v0.8.1 BSD-2-Clause\n    github.com/russross/blackfriday/v2 v2.0.1 BSD-2-Clause\n\n========================================================================\nMPL-2.0-no-copyleft-exception licenses\n========================================================================\n\n    github.com/hashicorp/consul/api v1.1.0 MPL-2.0-no-copyleft-exception\n    github.com/hashicorp/consul/sdk v0.1.1 MPL-2.0-no-copyleft-exception\n    github.com/hashicorp/go-cleanhttp v0.5.1 MPL-2.0-no-copyleft-exception\n    github.com/hashicorp/go-immutable-radix v1.0.0 MPL-2.0-no-copyleft-exception\n    github.com/hashicorp/go-multierror v1.0.0 MPL-2.0-no-copyleft-exception\n    github.com/hashicorp/go-rootcerts v1.0.0 MPL-2.0-no-copyleft-exception\n    github.com/hashicorp/go-sockaddr v1.0.0 MPL-2.0-no-copyleft-exception\n    github.com/hashicorp/go-uuid v1.0.1 MPL-2.0-no-copyleft-exception\n    github.com/hashicorp/golang-lru v0.5.1 MPL-2.0-no-copyleft-exception\n    github.com/hashicorp/logutils v1.0.0 MPL-2.0-no-copyleft-exception\n    github.com/hashicorp/memberlist v0.1.3 MPL-2.0-no-copyleft-exception\n\n========================================================================\nMPL-2.0 licenses\n========================================================================\n\n    github.com/hashicorp/errwrap v1.0.0 MPL-2.0\n    github.com/hashicorp/hcl v1.0.0 MPL-2.0\n    github.com/hashicorp/serf v0.8.2 MPL-2.0\n    github.com/mitchellh/cli v1.0.0 MPL-2.0\n    github.com/mitchellh/gox v0.4.0 MPL-2.0\n\n========================================================================\nMIT and Apache licenses\n========================================================================\n\n    gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 MIT and Apache\n\n========================================================================\nApache-2.0 licenses\n========================================================================\n\n    cloud.google.com/go v0.46.3 Apache-2.0\n    cloud.google.com/go/bigquery v1.0.1 Apache-2.0\n    cloud.google.com/go/datastore v1.0.0 Apache-2.0\n    cloud.google.com/go/firestore v1.1.0 Apache-2.0\n    cloud.google.com/go/pubsub v1.0.1 Apache-2.0\n    cloud.google.com/go/storage v1.0.0 Apache-2.0\n\n========================================================================\nBSD-3-Clause licenses\n========================================================================\n\n    dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 BSD-3-Clause\n    github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 BSD-3-Clause\n    github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc BSD-3-Clause\n    github.com/fsnotify/fsnotify v1.4.7 BSD-3-Clause\n```\n\n\u003c/details\u003e\n\n#### Check Dependencies' licenses\n\nThis command can be used to perform automatic license compatibility check, when there is incompatible licenses found,\nthe command will exit with status code 1 and fail the command.\n\n```bash\nlicense-eye -c test/testdata/.licenserc_for_test_check.yaml dep check\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eDependency Check Result\u003c/summary\u003e\n\n```\nINFO GITHUB_TOKEN is not set, license-eye won't comment on the pull request\nINFO Loading configuration from file: .licenserc.yaml\nWARNING Failed to resolve the license of \u003cgithub.com/gogo/protobuf\u003e: cannot identify license content\nWARNING Failed to resolve the license of \u003cgithub.com/kr/logfmt\u003e: cannot find license file\nWARNING Failed to resolve the license of \u003cgithub.com/magiconair/properties\u003e: cannot identify license content\nWARNING Failed to resolve the license of \u003cgithub.com/miekg/dns\u003e: cannot identify license content\nWARNING Failed to resolve the license of \u003cgithub.com/pascaldekloe/goe\u003e: cannot identify license content\nWARNING Failed to resolve the license of \u003cgithub.com/russross/blackfriday/v2\u003e: cannot identify license content\nWARNING Failed to resolve the license of \u003cgopkg.in/check.v1\u003e: cannot identify license content\nERROR the following licenses are incompatible with the main license: Apache-2.0\nLicense: Unknown Dependency: github.com/gogo/protobuf\nLicense: Unknown Dependency: github.com/kr/logfmt\nLicense: Unknown Dependency: github.com/magiconair/properties\nLicense: Unknown Dependency: github.com/miekg/dns\nLicense: Unknown Dependency: github.com/pascaldekloe/goe\nLicense: Unknown Dependency: github.com/russross/blackfriday/v2\nLicense: Unknown Dependency: gopkg.in/check.v1\nexit status 1\n```\n\n\u003c/details\u003e\n\n## Configurations\n\n```yaml\nheader: # \u003c1\u003e\n  license:\n    spdx-id: Apache-2.0 # \u003c2\u003e\n    copyright-owner: Apache Software Foundation # \u003c3\u003e\n    copyright-year: '1993-2022' # \u003c25\u003e\n    software-name: skywalking-eyes # \u003c4\u003e\n    content: | # \u003c5\u003e\n      Licensed to Apache Software Foundation (ASF) under one or more contributor\n      license agreements. See the NOTICE file distributed with\n      this work for additional information regarding copyright\n      ownership. Apache Software Foundation (ASF) licenses this file to you under\n      the Apache License, Version 2.0 (the \"License\"); you may\n      not use this file except in compliance with the License.\n      You may obtain a copy of the License at\n\n          http://www.apache.org/licenses/LICENSE-2.0\n\n      Unless required by applicable law or agreed to in writing,\n      software distributed under the License is distributed on an\n      \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n      KIND, either express or implied.  See the License for the\n      specific language governing permissions and limitations\n      under the License.\n\n    pattern: | # \u003c6\u003e\n      Licensed to the Apache Software Foundation under one or more contributor\n      license agreements. See the NOTICE file distributed with\n      this work for additional information regarding copyright\n      ownership. The Apache Software Foundation licenses this file to you under\n      the Apache License, Version 2.0 \\(the \"License\"\\); you may\n      not use this file except in compliance with the License.\n      You may obtain a copy of the License at\n\n          http://www.apache.org/licenses/LICENSE-2.0\n\n      Unless required by applicable law or agreed to in writing,\n      software distributed under the License is distributed on an\n      \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n      KIND, either express or implied.  See the License for the\n      specific language governing permissions and limitations\n      under the License.\n\n  paths: # \u003c7\u003e\n    - '**'\n\n  paths-ignore: # \u003c8\u003e\n    - 'dist'\n    - 'licenses'\n    - '**/*.md'\n    - '**/testdata/**'\n    - '**/go.mod'\n    - '**/go.sum'\n    - 'LICENSE'\n    - 'NOTICE'\n    - '**/assets/languages.yaml'\n    - '**/assets/assets.gen.go'\n\n  comment: on-failure # \u003c9\u003e\n\n  license-location-threshold: 80 # \u003c10\u003e\n\n  language: # \u003c11\u003e\n    Go: # \u003c12\u003e\n      extensions: #\u003c13\u003e\n        - \".go\"\n      filenames: #\u003c14\u003e\n        - \"config.go\"\n        - \"config_test.go\"\n      comment_style_id: DoubleSlash # \u003c15\u003e\n\ndependency: # \u003c16\u003e\n  files: # \u003c17\u003e\n    - go.mod\n  licenses: # \u003c18\u003e\n    - name: dependency-name # \u003c19\u003e\n      version: dependency-version # \u003c20\u003e\n      license: Apache-2.0 # \u003c21\u003e\n  threshold: 75 # \u003c22\u003e\n  excludes: # \u003c23\u003e\n    - name: dependency-name # the same format as \u003c19\u003e\n      version: dependency-version # the same format as \u003c20\u003e\n      recursive: true # whether to exclude all transitive dependencies brought by \u003cdependency-name\u003e, now only maven project supports this \u003c24\u003e\n```\n\n1. The `header` section is configurations for source codes license header. If you have multiple modules or packages in your project that have differing licenses, this section may contain a list of licenses:\n```yaml\nheader:\n  - path: \"/path/to/module/a\"\n    license:\n      spdx-id: Apache-2.0\n  - path: \"/path/to/module/b\"\n    license:\n      spdx-id: MPL-2.0\n```\n2. The [SPDX ID](https://spdx.org/licenses/) of the license, it’s convenient when your license is standard SPDX license, so that you can simply specify this identifier without copying the whole license `content` or `pattern`. This will be used as the content when `fix` command needs to insert a license header.\n3. The copyright owner to replace the `[owner]` in the `SPDX-ID` license template.\n4. The copyright software name to replace the `[software-name]` in the `SPDX-ID` license template.\n5. If you are not using the standard license text, you can paste your license text here, this will be used as the content when `fix` command needs to insert a license header, if both `license` and `SPDX-ID` are specified, `license` wins.\n6. The `pattern` is an optional regexp. You don’t need this if all the file headers are the same as `license` or the license of `SPDX-ID`, otherwise you need to compose a pattern that matches your existing license texts so that `license-eye` won't complain about the existing license headers. If you want to replace your existing license headers, you can compose a `pattern` that matches your existing license headers, and modify the `content` to what you want to have, then `license-eye header fix` would rewrite all the existing license headers to the wanted `content`.\n7. The `paths` are the path list that will be checked (and fixed) by license-eye, default is `['**']`. Formats like `**/*`.md and `**/bin/**` are supported.\n8. The `paths-ignore` are the path list that will be ignored by license-eye. By default, `.git` and the content in `.gitignore` will be inflated into the `paths-ignore` list.\n9. On what condition License-Eye will comment the check results on the pull request, `on-failure`, `always` or `never`. Options other than `never` require the environment variable `GITHUB_TOKEN` to be set.\n10. The `license-location-threshold` specifies the index threshold where the license header can be located.\n11. The `language` is an optional configuration. You can set the language license header comment style. If it doesn't exist, it will use the default configuration at the `languages.yaml`. An [example](test/testdata/.licenserc_language_config_test.yaml) is to use block comment style for Go codes.\n12. Specify the programming language identifier. You can set different configurations for multiple languages.\n13. The `extensions` are the files with these extensions which the configuration will take effect.\n14. The `filenames` are the specified files which the configuration will take effect.\n15. The `comment_style_id` set the license header comment style, it's the `id` at the `styles.yaml`.\n16. The `dependency` section is configurations for resolving dependencies' licenses.\n17. The `files` are the files that declare the dependencies of a project, typically, `go.mod` in Go project, `pom.xml` in maven project, and `package.json` in NodeJS project. If it's a relative path, it's relative to the `.licenserc.yaml`.\n18. Declare the licenses which cannot be identified by this tool.\n19. The `name` of the dependency, The name is different for different projects, `PackagePath` in Go project, `GroupID:ArtifactID` in maven project, `PackageName` in NodeJS project. You can use file pattern as described in [the doc](https://pkg.go.dev/path/filepath#Match).\n20. The `version` of the dependency, comma seperated string (such as `1.0,2.0,3.0`), if this is empty, it means all versions of the dependency.\n21. The [SPDX ID](https://spdx.org/licenses/) of the dependency license.\n22. The minimum percentage of the file that must contain license text for identifying a license, default is `75`.\n23. The dependencies that should be excluded when analyzing the licenses, this is useful when you declare the dependencies in `pom.xml` with `compile` scope but don't distribute them in package. (Note that non-`compile` scope dependencies are automatically excluded so you don't need to put them here).\n24. The transitive dependencies brought by \u003c23\u003e should be recursively excluded when analyzing the licenses, currently only maven project supports this.\n25. The copyright year of the work, if it's empty, it will be set to the current year. If you don't want to update the license year anually, you can set this to the year of the first publication of your work, such as `1994`, or `1994-2023`.\n\n**NOTE**: When the `SPDX-ID` is Apache-2.0 and the owner is Apache Software foundation, the content would be [a dedicated license](https://www.apache.org/legal/src-headers.html#headers) specified by the ASF, otherwise, the license would be [the standard one](https://www.apache.org/foundation/license-faq.html#Apply-My-Software).\n\n## Supported File Types\n\nThe `header check` command theoretically supports all kinds of file types, while the supported file types of `header fix` command can be found [in this YAML file](assets/languages.yaml). In the YAML file, if the language has a non-empty property `comment_style_id`, and the comment style id is declared in [the comment styles file](assets/styles.yaml), then the language is supported by `fix` command.\n\n- [assets/languages.yaml](assets/languages.yaml)\n\n  ```yaml\n  Java:\n    type: programming\n    tm_scope: source.java\n    ace_mode: java\n    codemirror_mode: clike\n    codemirror_mime_type: text/x-java\n    color: \"#b07219\"\n    extensions:\n      - \".java\"\n    language_id: 181\n    comment_style_id: SlashAsterisk\n  ```\n\n- [assets/styles.yaml](assets/styles.yaml)\n\n  ```yaml\n  - id: SlashAsterisk     # (i)\n    start: '/*'           # (ii)\n    middle: ' *'          # (iii)\n    end: ' */'            # (iv)\n  ```\n\n  1. The `comment_style_id` used in [assets/languages.yaml](assets/languages.yaml).\n  2. The leading characters of the starting of a block comment.\n  3. The leading characters of the middle lines of a block comment.\n  4. The leading characters of the ending line of a block comment.\n\n## Technical Documentation\n\n- There is an [activity diagram](./docs/header_fix_logic.svg) explaining the implemented license header\n  fixing mechanism in-depth. The diagram's source file can be found [here](./docs/header_fix_logic.plantuml).\n\n## Contribution\n\n- If you find any file type should be supported by the aforementioned configurations, but it's not listed there, feel free to [open a pull request](https://github.com/apache/skywalking-eyes/pulls) to add the configuration into the two files.\n- If you find the license template of an SPDX ID is not supported, feel free to [open a pull request](https://github.com/apache/skywalking-eyes/pulls) to add it into [the template folder](assets/header-templates).\n\n## License\n\n[Apache License 2.0](https://github.com/apache/skywalking-eyes/blob/master/LICENSE)\n\n## Contact Us\n* Mail list: **dev@skywalking.apache.org**. Mail to `dev-subscribe@skywalking.apache.org`, follow the reply to subscribe the mail list.\n* Send `Request to join SkyWalking slack` mail to the mail list(`dev@skywalking.apache.org`), we will invite you in.\n* For Chinese speaker, send `[CN] Request to join SkyWalking slack` mail to the mail list(`dev@skywalking.apache.org`), we will invite you in.\n* Twitter, [ASFSkyWalking](https://twitter.com/AsfSkyWalking)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fskywalking-eyes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fskywalking-eyes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fskywalking-eyes/lists"}