From a0d15378e44b8b57c52bcc35ab9e859d68172c19 Mon Sep 17 00:00:00 2001 From: Kevin Zou <17015060+nkzou@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:34:31 -0500 Subject: [PATCH] Add License csv and tool (#10) --- .github/workflows/test.yml | 3 +- .pre-commit-config.yaml | 36 ++++++----- LICENSE-3rdparty.csv | 120 +++++++++++++++++++++++++++++++++++++ generate.sh | 3 +- license-tool.toml | 2 + scripts/license-check.sh | 6 ++ 6 files changed, 154 insertions(+), 16 deletions(-) create mode 100644 LICENSE-3rdparty.csv create mode 100644 license-tool.toml create mode 100755 scripts/license-check.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff06f3fc8..2d03f60a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,9 +79,10 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - name: Install Rust - uses: dtolnay/rust-toolchain@master + uses: dtolnay/rust-toolchain@v1 with: toolchain: ${{ matrix.rust-version }} + - uses: Swatinem/rust-cache@v2 - name: Test run: cargo build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0216ab919..e8a0b6c74 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,28 +3,36 @@ repos: hooks: - id: generate name: Generate - language: node + language: system entry: bash -c "./generate.sh" files: '^(\.generator/.*|\.pre-commit-config\.yaml|Makefile|\tests/scenarios/features/.*)' pass_filenames: false - - id: lint - name: Lint - entry: cargo clippy - language: system - pass_filenames: false + verbose: true + - id: generator + name: generator + language: python + entry: bash -c "cd .generator && poetry install && poetry run python -m generator ./schemas/v1/openapi.yaml ./schemas/v2/openapi.yaml -o ../src/" + files: "^.generator/.*" stages: [manual] + pass_filenames: false + additional_dependencies: + - "poetry" - id: format name: Format - language: rust + language: system entry: cargo fmt pass_filenames: false stages: [manual] - - id: generator - name: generator - language: python - entry: bash -c "cd .generator && poetry install && poetry run python -m generator ./schemas/v1/openapi.yaml ./schemas/v2/openapi.yaml -o ../src/" - files: "^.generator/(config|schemas/v1|src|poetry.lock|pyproject.toml)" + - id: lint + name: Lint + entry: cargo check + language: system + pass_filenames: false stages: [manual] + - id: license-check + name: Check license file + entry: bash -c "scripts/license-check.sh" + language: system + stages: ["manual"] + verbose: true pass_filenames: false - additional_dependencies: - - "poetry" \ No newline at end of file diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv new file mode 100644 index 000000000..55a70a633 --- /dev/null +++ b/LICENSE-3rdparty.csv @@ -0,0 +1,120 @@ +Component,Origin,License,Copyright +addr2line,https://github.com/gimli-rs/addr2line,Apache-2.0 OR MIT,The addr2line Authors +adler,https://github.com/jonas-schievink/adler,0BSD OR MIT OR Apache-2.0,Jonas Schievink +android-tzdata,https://github.com/RumovZ/android-tzdata,MIT OR Apache-2.0,RumovZ +android_system_properties,https://github.com/nical/android_system_properties,MIT OR Apache-2.0,Nicolas Silva +anyhow,https://github.com/dtolnay/anyhow,MIT OR Apache-2.0,David Tolnay +async-trait,https://github.com/dtolnay/async-trait,MIT OR Apache-2.0,David Tolnay +backtrace,https://github.com/rust-lang/backtrace-rs,MIT OR Apache-2.0,The Rust Project Developers +base64,https://github.com/marshallpierce/rust-base64,MIT OR Apache-2.0,"Alice Maz , Marshall Pierce " +bitflags,https://github.com/bitflags/bitflags,MIT OR Apache-2.0,The Rust Project Developers +bumpalo,https://github.com/fitzgen/bumpalo,MIT OR Apache-2.0,Nick Fitzgerald +bytes,https://github.com/tokio-rs/bytes,MIT,"Carl Lerche , Sean McArthur " +cfg-if,https://github.com/alexcrichton/cfg-if,MIT OR Apache-2.0,Alex Crichton +chrono,https://github.com/chronotope/chrono,MIT OR Apache-2.0,The chrono Authors +core-foundation,https://github.com/servo/core-foundation-rs,MIT OR Apache-2.0,The Servo Project Developers +darling,https://github.com/TedDriggs/darling,MIT,Ted Driggs +encoding_rs,https://github.com/hsivonen/encoding_rs,(Apache-2.0 OR MIT) AND BSD-3-Clause,Henri Sivonen +errno,https://github.com/lambda-fairy/rust-errno,MIT OR Apache-2.0,Chris Wong +errno-dragonfly,https://github.com/mneumann/errno-dragonfly-rs,MIT,Michael Neumann +fastrand,https://github.com/smol-rs/fastrand,Apache-2.0 OR MIT,Stjepan Glavina +fnv,https://github.com/servo/rust-fnv,Apache-2.0 OR MIT,Alex Crichton +foreign-types,https://github.com/sfackler/foreign-types,MIT OR Apache-2.0,Steven Fackler +futures,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures Authors +futures-channel,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-channel Authors +futures-core,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-core Authors +futures-executor,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-executor Authors +futures-io,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-io Authors +futures-macro,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-macro Authors +futures-sink,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-sink Authors +futures-task,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-task Authors +futures-util,https://github.com/rust-lang/futures-rs,MIT OR Apache-2.0,The futures-util Authors +gimli,https://github.com/gimli-rs/gimli,MIT OR Apache-2.0,The gimli Authors +h2,https://github.com/hyperium/h2,MIT,"Carl Lerche , Sean McArthur " +hashbrown,https://github.com/rust-lang/hashbrown,MIT OR Apache-2.0,Amanieu d'Antras +hermit-abi,https://github.com/hermitcore/hermit-rs,MIT OR Apache-2.0,Stefan Lankes +hex,https://github.com/KokaKiwi/rust-hex,MIT OR Apache-2.0,KokaKiwi +http,https://github.com/hyperium/http,MIT OR Apache-2.0,"Alex Crichton , Carl Lerche , Sean McArthur " +http-body,https://github.com/hyperium/http-body,MIT,"Carl Lerche , Lucio Franco , Sean McArthur " +httparse,https://github.com/seanmonstar/httparse,MIT OR Apache-2.0,Sean McArthur +httpdate,https://github.com/pyfisch/httpdate,MIT OR Apache-2.0,Pyfisch +hyper,https://github.com/hyperium/hyper,MIT,Sean McArthur +hyper-tls,https://github.com/hyperium/hyper-tls,MIT OR Apache-2.0,Sean McArthur +iana-time-zone,https://github.com/strawlab/iana-time-zone,MIT OR Apache-2.0,"Andrew Straw , René Kijewski , Ryan Lopopolo " +iana-time-zone-haiku,https://github.com/strawlab/iana-time-zone,MIT OR Apache-2.0,René Kijewski +ident_case,https://github.com/TedDriggs/ident_case,MIT OR Apache-2.0,Ted Driggs +indexmap,https://github.com/bluss/indexmap,Apache-2.0 OR MIT,The indexmap Authors +ipnet,https://github.com/krisprice/ipnet,MIT OR Apache-2.0,Kris Price +itoa,https://github.com/dtolnay/itoa,MIT OR Apache-2.0,David Tolnay +js-sys,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/js-sys,MIT OR Apache-2.0,The wasm-bindgen Developers +lazy_static,https://github.com/rust-lang-nursery/lazy-static.rs,MIT OR Apache-2.0,Marvin Löbel +libc,https://github.com/rust-lang/libc,MIT OR Apache-2.0,The Rust Project Developers +linux-raw-sys,https://github.com/sunfishcode/linux-raw-sys,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,Dan Gohman +log,https://github.com/rust-lang/log,MIT OR Apache-2.0,The Rust Project Developers +memchr,https://github.com/BurntSushi/memchr,Unlicense OR MIT,"Andrew Gallant , bluss" +mime,https://github.com/hyperium/mime,MIT OR Apache-2.0,Sean McArthur +mime_guess,https://github.com/abonander/mime_guess,MIT,Austin Bonander +miniz_oxide,https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide,MIT OR Zlib OR Apache-2.0,"Frommi , oyvindln " +mio,https://github.com/tokio-rs/mio,MIT,"Carl Lerche , Thomas de Zeeuw , Tokio Contributors " +native-tls,https://github.com/sfackler/rust-native-tls,MIT OR Apache-2.0,Steven Fackler +num-traits,https://github.com/rust-num/num-traits,MIT OR Apache-2.0,The Rust Project Developers +num_cpus,https://github.com/seanmonstar/num_cpus,MIT OR Apache-2.0,Sean McArthur +object,https://github.com/gimli-rs/object,Apache-2.0 OR MIT,The object Authors +once_cell,https://github.com/matklad/once_cell,MIT OR Apache-2.0,Aleksey Kladov +openssl,https://github.com/sfackler/rust-openssl,Apache-2.0,Steven Fackler +openssl-macros,https://github.com/sfackler/rust-openssl,MIT OR Apache-2.0,The openssl-macros Authors +openssl-probe,https://github.com/alexcrichton/openssl-probe,MIT OR Apache-2.0,Alex Crichton +openssl-sys,https://github.com/sfackler/rust-openssl,MIT,"Alex Crichton , Steven Fackler " +pin-project-lite,https://github.com/taiki-e/pin-project-lite,Apache-2.0 OR MIT,The pin-project-lite Authors +pin-utils,https://github.com/rust-lang-nursery/pin-utils,MIT OR Apache-2.0,Josef Brandl +proc-macro2,https://github.com/dtolnay/proc-macro2,MIT OR Apache-2.0,"David Tolnay , Alex Crichton " +quote,https://github.com/dtolnay/quote,MIT OR Apache-2.0,David Tolnay +redox_syscall,https://gitlab.redox-os.org/redox-os/syscall,MIT,Jeremy Soller +reqwest,https://github.com/seanmonstar/reqwest,MIT OR Apache-2.0,Sean McArthur +reqwest-middleware,https://github.com/TrueLayer/reqwest-middleware,MIT OR Apache-2.0,Rodrigo Gryzinski +rustc-demangle,https://github.com/alexcrichton/rustc-demangle,MIT OR Apache-2.0,Alex Crichton +rustix,https://github.com/bytecodealliance/rustix,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,"Dan Gohman , Jakub Konka " +ryu,https://github.com/dtolnay/ryu,Apache-2.0 OR BSL-1.0,David Tolnay +schannel,https://github.com/steffengy/schannel-rs,MIT,"Steven Fackler , Steffen Butzer " +security-framework,https://github.com/kornelski/rust-security-framework,MIT OR Apache-2.0,"Steven Fackler , Kornel " +serde,https://github.com/serde-rs/serde,MIT OR Apache-2.0,"Erick Tryzelaar , David Tolnay " +serde_derive,https://github.com/serde-rs/serde,MIT OR Apache-2.0,David Tolnay +serde_json,https://github.com/serde-rs/json,MIT OR Apache-2.0,"Erick Tryzelaar , David Tolnay " +serde_repr,https://github.com/dtolnay/serde-repr,MIT OR Apache-2.0,David Tolnay +serde_urlencoded,https://github.com/nox/serde_urlencoded,MIT OR Apache-2.0,Anthony Ramine +serde_with,https://github.com/jonasbb/serde_with,MIT OR Apache-2.0,"Jonas Bushart, Marcin Kaźmierczak" +serde_with_macros,https://github.com/jonasbb/serde_with,MIT OR Apache-2.0,Jonas Bushart +slab,https://github.com/tokio-rs/slab,MIT,Carl Lerche +socket2,https://github.com/rust-lang/socket2,MIT OR Apache-2.0,"Alex Crichton , Thomas de Zeeuw " +strsim,https://github.com/dguo/strsim-rs,MIT,Danny Guo +syn,https://github.com/dtolnay/syn,MIT OR Apache-2.0,David Tolnay +task-local-extensions,https://github.com/TrueLayer/task-local-extensions,MIT OR Apache-2.0,"Conrad Ludgate , Rodrigo Gryzinski " +tempfile,https://github.com/Stebalien/tempfile,MIT OR Apache-2.0,"Steven Allen , The Rust Project Developers, Ashley Mannix , Jason White " +thiserror,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay +time,https://github.com/time-rs/time,MIT OR Apache-2.0,"Jacob Pratt , Time contributors" +tinyvec,https://github.com/Lokathor/tinyvec,Zlib OR Apache-2.0 OR MIT,Lokathor +tinyvec_macros,https://github.com/Soveu/tinyvec_macros,MIT OR Apache-2.0 OR Zlib,Soveu +tokio,https://github.com/tokio-rs/tokio,MIT,Tokio Contributors +tokio-native-tls,https://github.com/tokio-rs/tls,MIT,Tokio Contributors +tower-service,https://github.com/tower-rs/tower,MIT,Tower Maintainers +tracing,https://github.com/tokio-rs/tracing,MIT,"Eliza Weisman , Tokio Contributors " +tracing-attributes,https://github.com/tokio-rs/tracing,MIT,"Tokio Contributors , Eliza Weisman , David Barsky " +tracing-core,https://github.com/tokio-rs/tracing,MIT,Tokio Contributors +try-lock,https://github.com/seanmonstar/try-lock,MIT,Sean McArthur +unicase,https://github.com/seanmonstar/unicase,MIT OR Apache-2.0,Sean McArthur +unicode-bidi,https://github.com/servo/unicode-bidi,MIT OR Apache-2.0,The Servo Project Developers +unicode-ident,https://github.com/dtolnay/unicode-ident,(MIT OR Apache-2.0) AND Unicode-DFS-2016,David Tolnay +unicode-normalization,https://github.com/unicode-rs/unicode-normalization,MIT OR Apache-2.0,"kwantam , Manish Goregaokar " +url,https://github.com/servo/rust-url,MIT OR Apache-2.0,The rust-url developers +want,https://github.com/seanmonstar/want,MIT,Sean McArthur +wasi,https://github.com/bytecodealliance/wasi,Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT,The Cranelift Project Developers +wasm-bindgen,https://github.com/rustwasm/wasm-bindgen,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-backend,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-futures,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/futures,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-macro,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-macro-support,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/macro-support,MIT OR Apache-2.0,The wasm-bindgen Developers +wasm-bindgen-shared,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/shared,MIT OR Apache-2.0,The wasm-bindgen Developers +web-sys,https://github.com/rustwasm/wasm-bindgen/tree/master/crates/web-sys,MIT OR Apache-2.0,The wasm-bindgen Developers +winapi,https://github.com/retep998/winapi-rs,MIT OR Apache-2.0,Peter Atashian +windows,https://github.com/microsoft/windows-rs,MIT OR Apache-2.0,Microsoft +winreg,https://github.com/gentoo90/winreg-rs,MIT,Igor Shaula diff --git a/generate.sh b/generate.sh index df529f973..573622df8 100755 --- a/generate.sh +++ b/generate.sh @@ -26,4 +26,5 @@ pre_commit_wrapper () { rm -rf src/* examples/* pre_commit_wrapper generator pre_commit_wrapper format -pre_commit_wrapper lint \ No newline at end of file +pre_commit_wrapper lint +pre_commit_wrapper license-check diff --git a/license-tool.toml b/license-tool.toml new file mode 100644 index 000000000..f30507612 --- /dev/null +++ b/license-tool.toml @@ -0,0 +1,2 @@ +[overrides] +"openssl-macros" = { origin = "https://github.com/sfackler/rust-openssl" } diff --git a/scripts/license-check.sh b/scripts/license-check.sh new file mode 100755 index 000000000..04571927b --- /dev/null +++ b/scripts/license-check.sh @@ -0,0 +1,6 @@ +cargo install --quiet dd-rust-license-tool +dd-rust-license-tool check +if [ $? -ne 0 ]; then + echo "Run 'dd-rust-license-tool write' to regenerate license csv file." +fi +exit 0 \ No newline at end of file