diff --git a/.github/workflows/bump-n-release.yml b/.github/workflows/bump-n-release.yml index dfbcbf8a..ef8ff8ad 100644 --- a/.github/workflows/bump-n-release.yml +++ b/.github/workflows/bump-n-release.yml @@ -40,7 +40,7 @@ jobs: - run: yarn global add @napi-rs/cli - uses: cargo-bins/cargo-binstall@main - run: cargo binstall -y git-cliff - - name: Bump ${{ inputs.component }} verion + - name: Bump ${{ inputs.component }} version env: GITHUB_TOKEN: ${{ secrets.BUMP_N_RELEASE }} GH_TOKEN: ${{ secrets.BUMP_N_RELEASE }} diff --git a/LICENSE b/LICENSE index 6c80e74e..b9c4642f 100644 --- a/LICENSE +++ b/LICENSE @@ -2,8 +2,20 @@ MIT License Copyright (c) 2024 2bndy5 -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 91840d4e..476320d1 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [step-summary]: https://cpp-linter.github.io/cpp-linter-rs/cli#-w-step-summary [tidy-review]: https://cpp-linter.github.io/cpp-linter-rs/cli#-d-tidy-review [format-review]: https://cpp-linter.github.io/cpp-linter-rs/cli#-m-format-review +[other-licenses]: https://cpp-linter.github.io/cpp-linter-rs/other-licenses [format-annotations-preview]: docs/docs/images/annotations-clang-format.png [tidy-annotations-preview]: docs/docs/images/annotations-clang-tidy.png @@ -172,56 +173,8 @@ To provide feedback (requesting a feature or reporting a bug) please post to ## License -The scripts and documentation in this project are released under the [MIT]. - -Dependencies (that are redistributed by us in binary form) have the following -license agreements: - -- [clap](https://crates.io/crates/clap): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. -- [git2](https://crates.io/crates/git2): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. - - The following are conditionally included in binaries (using the `openssl-vendored` feature on a - case-by-case basis) because it is a dependency of git2: - - - [openssl](https://crates.io/crates/openssl): Licensed under [Apache 2.0][Apache2] - - [openssl-probe](https://crates.io/crates/openssl-probe): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. - -- [lenient_semver](https://crates.io/crates/lenient_semver): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. -- [log](https://crates.io/crates/log): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. -- [regex](https://crates.io/crates/regex): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. -- [reqwest](https://crates.io/crates/reqwest): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. -- [semver](https://crates.io/crates/semver): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. -- [serde](https://crates.io/crates/serde): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. -- [serde-xml-rs](https://crates.io/crates/serde-xml-rs): Licensed under [MIT]. -- [serde_json](https://crates.io/crates/serde_json): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. -- [which](https://crates.io/crates/which): Licensed under [MIT]. -- [tokio](https://crates.io/crates/tokio): Licensed under [MIT]. -- [futures](https://crates.io/crates/futures): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. -- [chrono](https://crates.io/crates/chrono): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. -- [colored](https://crates.io/crates/colored): Licensed under [MPL-2.0] - -The python binding uses - -- [pyo3](https://crates.io/crates/pyo3): - Dual-licensed under [Apache 2.0][Apache2] or [MIT]. - -The node binding uses - -- [napi](https://crates.io/crates/napi): Licensed under [MIT] -- [napi-derive](https://crates.io/crates/napi-derive): Licensed under [MIT] +The scripts and documentation in this project are released under the [MIT] license. + +As for dependencies (that are redistributed by us in binary form) and their licenses, refer to [THIRD-PARTY LICENSES][other-licenses]. [MIT]: https://choosealicense.com/licenses/mit -[Apache2]: https://choosealicense.com/licenses/apache-2.0/ -[MPL-2.0]: https://choosealicense.com/licenses/mpl-2.0 diff --git a/docs/docs/index.md b/docs/docs/index.md index 627e8a7e..e13f7edf 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -5,6 +5,7 @@ [step-summary]: cli.md#-w-step-summary [tidy-review]: cli.md#-d-tidy-review [format-review]: cli.md#-m-format-review +[other-licenses]: other-licenses.md [format-annotations-preview]: images/annotations-clang-format.png [tidy-annotations-preview]: images/annotations-clang-tidy.png diff --git a/docs/docs/other-licenses.md b/docs/docs/other-licenses.md new file mode 100644 index 00000000..af04be4a --- /dev/null +++ b/docs/docs/other-licenses.md @@ -0,0 +1,5 @@ +# Third-party Licenses + +This page is generated when mkdocs builds. +All content here is overwritten when building the docs. +For changes to this document, please refer to [license_gen.py](../license_gen.py). diff --git a/docs/license_gen.py b/docs/license_gen.py new file mode 100644 index 00000000..2df5110c --- /dev/null +++ b/docs/license_gen.py @@ -0,0 +1,70 @@ +import mkdocs_gen_files +from subprocess import run + +FILENAME = "other-licenses.md" + +INTRO = """# Third-party Licenses + +[MIT]: https://choosealicense.com/licenses/mit +[Apache-2.0]: https://choosealicense.com/licenses/apache-2.0/ +[MPL-2.0]: https://choosealicense.com/licenses/mpl-2.0 +""" + +OPTIONAL_DEPS = """## Optional dependencies + +The following are conditionally included in binaries (using the `openssl-vendored` +feature on a case-by-case basis) because it is a dependency of +[git2](https://crates.io/crates/git2): + +- [openssl](https://crates.io/crates/openssl): Licensed under [Apache-2.0]. +- [openssl-probe](https://crates.io/crates/openssl-probe): + Dual-licensed under [Apache-2.0] or [MIT]. +""" + +BINDING_DEPS = """## Bindings' dependencies + +The python binding uses + +- [pyo3](https://crates.io/crates/pyo3): + Dual-licensed under [Apache-2.0] or [MIT]. + +The node binding uses + +- [napi](https://crates.io/crates/napi): Licensed under [MIT] +- [napi-derive](https://crates.io/crates/napi-derive): Licensed under [MIT] +""" + +with mkdocs_gen_files.open(FILENAME, "w") as io_doc: + print(INTRO, file=io_doc) + output = run( + [ + "cargo", + "tree", + "-f", + r"[{p}]({r}): Licensed under {l}", + "-e", + "normal", + "-p", + "cpp-linter", + "--depth", + "1", + ], + capture_output=True, + check=True, + ) + doc = "\n".join( + [ + "- " + + line[3:] + .replace(" MIT", " [MIT]") + .replace(" Apache-2.0", " [Apache-2.0]") + .replace(" MPL-2.0", " [MPL-2.0]") + for line in output.stdout.decode(encoding="utf-8").splitlines()[1:] + ] + ) + # print(doc) + print(doc, file=io_doc) + print(f"\n{OPTIONAL_DEPS}\n", file=io_doc) + print(f"\n{BINDING_DEPS}\n", file=io_doc) + +mkdocs_gen_files.set_edit_path(FILENAME, "license-gen.py") diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index a968d563..48cbb107 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -12,6 +12,7 @@ nav: - python.md - node.md - changelog.md + - other-licenses.md theme: name: material @@ -78,6 +79,7 @@ plugins: - gen-files: scripts: - gen_cli_doc.py + - license_gen.py markdown_extensions: - pymdownx.superfences