From 6d226be76b3708c98a52ec831a8d2e965e4acac8 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 17:52:25 -0300 Subject: [PATCH 01/93] Change CI --- .github/workflows/test-detectors.yml | 110 +++++++++------------------ 1 file changed, 34 insertions(+), 76 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 3c17adc4..de777e14 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -5,13 +5,11 @@ on: branches: - "main" paths: - - "apps/cargo-scout-audit/**" - "detectors/**" - "test-cases/**" - "Makefile" pull_request: paths: - - "apps/cargo-scout-audit/**" - "detectors/**" - "test-cases/**" - "Makefile" @@ -22,36 +20,8 @@ env: RUST_BACKTRACE: full jobs: - check-config: - name: Check config - strategy: - matrix: - os: - - ubuntu-latest - - macos-latest - runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install python dependencies - run: pip3 install pyyaml - - - name: Check test matrix is complete - run: python3 scripts/check-ci-detectors-to-test.py .github/workflows/test-detectors.yml detectors - - - name: Check detectors for repeated names - run: python3 scripts/check-detectors-repeated-names.py detectors - - - name: Check detector names with underscore - run: python3 scripts/check-detectors-underscore-names.py detectors - - - name: Check detector names different than their folders - run: python3 scripts/check-detectors-names-match-folder.py detectors - build: name: Build - needs: check-config strategy: matrix: os: @@ -60,75 +30,63 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache cargo-scout dependencies id: cache-cargo-scout-dependencies - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: | ~/.cargo - apps/cargo-scout-audit/target - detectors/target - detectors/Cargo.lock key: ${{ runner.os }}-cargo-scout-dependencies-${{ github.run_id }} - - name: Install Rust nightly-2023-09-29 - run: rustup install nightly-2023-09-29 --profile minimal + - name: Update Rust Toolchain + run: rustup update - - name: Install dylint-link - run: cargo install dylint-link + - name: Install dylint and dylint-link + run: cargo +nightly install cargo-dylint dylint-link - - name: Compile cargo-scout-audit tests - working-directory: apps/cargo-scout-audit - run: cargo test --no-run + - name: Install cargo-scout-audit + run: cargo +nightly install cargo-scout-audit - - name: Compile detectors - working-directory: detectors - run: cargo build --release + prepare-test-matrix: + name: Prepare Test Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - id: set-matrix + run: | + echo "::set-output name=matrix::$(find test-cases -mindepth 1 -maxdepth 1 -type d -printf '"%f", ' | sed 's/, $//')" - test: - name: Test - needs: build + integration-tests: + name: Integration Tests + needs: [build, prepare-test-matrix] strategy: + fail-fast: false matrix: os: - ubuntu-latest - macos-latest - test: - [ - "avoid-core-mem-forget", - "avoid-panic-error", - "avoid-unsafe-block", - "divide-before-multiply", - "dos-unbounded-operation", - "insufficiently-random-values", - "overflow-check", - "set-contract-storage", - "unprotected-update-current-contract-wasm", - "unsafe-expect", - "unsafe-unwrap", - "unused-return-enum", - ] + test-case: ${{fromJson(needs.prepare-test-matrix.outputs.matrix)}} runs-on: ${{ matrix.os }} steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Cache cargo-scout dependencies - id: cache-cargo-scout-dependencies - uses: actions/cache@v3 + - name: Cache cargo dependencies + uses: actions/cache@v4 with: path: | ~/.cargo - apps/cargo-scout-audit/target - detectors/target - detectors/Cargo.lock - key: ${{ runner.os }}-cargo-scout-dependencies-${{ github.run_id }} + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} fail-on-cache-miss: true - - name: Run tests - working-directory: apps/cargo-scout-audit - env: - INTEGRATION_TESTS_TO_RUN: ${{ matrix.test }} - run: cargo test -- --nocapture + - name: Run integration test for a specific test case + run: | + cd ${{ matrix.test-case }} + cargo test From fd697d883142912d69b5037f44a27fc2e4989658 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 17:53:06 -0300 Subject: [PATCH 02/93] Trigger CI --- test-cases/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test-cases/README.md b/test-cases/README.md index 18afcac7..197bf071 100644 --- a/test-cases/README.md +++ b/test-cases/README.md @@ -57,7 +57,6 @@ Check our [test-cases](https://github.com/CoinFabrik/scout-soroban/tree/main/test-cases) for code examples of these vulnerabilities and their respective remediations. - ### Divide before multiply This vulnerability class relates to the order of operations in Rust, specifically in integer arithmetic. Performing a division operation before a multiplication can lead to a loss of precision. This issue becomes significant in programs like smart contracts where numerical precision is crucial. @@ -65,7 +64,6 @@ This vulnerability class relates to the order of operations in Rust, specificall This vulnerability falls under the [Arithmetic](#vulnerability-categories) category and has a Medium Severity. - ### Unsafe unrwap This vulnerability class pertains to the inappropriate usage of the `unwrap` method in Rust, which is commonly employed for error handling. The `unwrap` method retrieves the inner value of an `Option` or `Result`, but if an error or `None` occurs, it triggers a panic and crashes the program. @@ -74,7 +72,6 @@ This vulnerability again falls under the [Validations and error handling](#vulne In our example, we consider an contract that utilizes the `unwrap` method to retrieve the balance of an account from a mapping. If there is no entry for the specified account, the contract will panic and abruptly halt execution, opening avenues for malicious exploitation. - ### Unsafe expect In Rust, the `expect` method is commonly used for error handling. It retrieves the value from a `Result` or `Option` and panics with a specified error message if an error occurs. However, using `expect` can lead to unexpected program crashes. @@ -105,7 +102,6 @@ Notwithstanding, there are contexts where developers do turn off checks for valid reasons and hence the reason for including this vulnerability in the list. - ### Insufficiently random values Using block attributes like ledger `timestamp()` and ledger `sequence()` for random number generation in Soroban smart contracts is not recommended due to the predictability of these values. Block attributes are publicly visible and deterministic, making it easy for malicious actors to anticipate their values and manipulate outcomes to their advantage. Furthermore, validators could potentially influence these attributes, further exacerbating the risk of manipulation. For truly random number generation, it's important to use a source that is both unpredictable and external to the blockchain environment, reducing the potential for malicious exploitation. From e40b4839aa6a05d3f665e723316b9fa3f568dfc4 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 18:07:17 -0300 Subject: [PATCH 03/93] Update general rust --- .github/workflows/general-rust.yml | 95 ++++++++++++++++++++++-------- 1 file changed, 69 insertions(+), 26 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 0e7444ec..59e945e9 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -5,13 +5,11 @@ on: branches: - "main" paths: - - "apps/cargo-scout-audit/**" - "detectors/**" - "test-cases/**" - "Makefile" pull_request: paths: - - "apps/cargo-scout-audit/**" - "detectors/**" - "test-cases/**" - "Makefile" @@ -22,48 +20,93 @@ env: jobs: format: - name: Format + name: Check Rust Format runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 + - name: Checkout Code + uses: actions/checkout@v4 - - name: Update Rust + - name: Update Rust Toolchain run: rustup update - name: Install Rust nightly run: rustup install nightly --profile minimal - - name: Install Rustfmt - run: rustup component add rustfmt --toolchain nightly + - name: Install rustfmt + run: rustup component add rustfmt + + - name: Check Formatting in Detectors + run: | + cd detectors + cargo +nightly fmt -- --check - - name: Run cargo fmt - run: make fmt-rust-check + - name: Check Formatting in Test Cases + run: | + find test-cases -name Cargo.toml -execdir cargo +nightly fmt -- --check \; clippy: - name: Clippy + name: Lint with Clippy runs-on: ubuntu-latest + steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout Code + uses: actions/checkout@v4 - - name: Cache cargo-scout-audit dependencies - id: cache-cargo-scout-audit-dependencies - uses: actions/cache@v3 + - name: Cache Rust Dependencies + uses: actions/cache@v4 with: - path: ./apps/cargo-scout-audit/target - key: ${{ runner.os }}-cargo-${{ hashFiles('apps/cargo-scout-audit/Cargo.lock') }} + path: | + ~/.cargo + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Update Rust + - name: Update Rust Toolchain run: rustup update - - name: Install Rust nightly-2023-09-29 - run: rustup install nightly-2023-09-29-x86_64-unknown-linux-gnu --profile minimal + - name: Install Rust nightly + run: rustup install nightly --profile minimal + + - name: Install clippy + run: rustup component add clippy + + - name: Lint Code in Detectors + run: | + cd detectors + cargo clippy --all-targets --all-features -- -D warnings + + - name: Lint Code in Test Cases + run: | + find test-cases -name Cargo.toml -execdir cargo clippy --all-targets --all-features -- -D warnings \; + + udeps: + name: Check Unused Dependencies with cargo-udeps + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Cache Rust Dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cargo + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Update Rust Toolchain + run: rustup update + + - name: Install Rust nightly + run: rustup install nightly --profile minimal - - name: Install Clippy - run: rustup component add clippy --toolchain nightly-2023-09-29-x86_64-unknown-linux-gnu + - name: Install cargo-udeps + run: cargo install cargo-udeps - - name: Install dylint-link - run: cargo install dylint-link + - name: Check Unused Dependencies in Detectors + run: | + cd detectors + cargo +nightly udeps --all-targets - - name: Run clippy - run: make lint + - name: Check Unused Dependencies in Test Cases + run: | + find test-cases -name Cargo.toml -execdir cargo +nightly udeps --all-targets \; From 35f7c85c175d325bfb134c32ded76799dd9a3b80 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 18:09:57 -0300 Subject: [PATCH 04/93] Update general and integration --- .github/workflows/general-rust.yml | 2 +- .github/workflows/test-detectors.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 59e945e9..6073fb66 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -34,7 +34,7 @@ jobs: run: rustup install nightly --profile minimal - name: Install rustfmt - run: rustup component add rustfmt + run: rustup component add rustfmt --toolchain nightly - name: Check Formatting in Detectors run: | diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index de777e14..15d7ca1a 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -43,6 +43,9 @@ jobs: - name: Update Rust Toolchain run: rustup update + - name: Install Rust nightly + run: rustup install nightly --profile minimal + - name: Install dylint and dylint-link run: cargo +nightly install cargo-dylint dylint-link From 1dde419c9d8a0ec6b25063f8eac4a382ddde0eca Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 18:13:53 -0300 Subject: [PATCH 05/93] Edit general rust --- .github/workflows/general-rust.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 6073fb66..8262b732 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -38,12 +38,11 @@ jobs: - name: Check Formatting in Detectors run: | - cd detectors - cargo +nightly fmt -- --check + cd detectors && cargo +nightly fmt -- --check -v - name: Check Formatting in Test Cases run: | - find test-cases -name Cargo.toml -execdir cargo +nightly fmt -- --check \; + find test-cases -name Cargo.toml -execdir cargo +nightly fmt -- --check -v \; clippy: name: Lint with Clippy @@ -67,12 +66,11 @@ jobs: run: rustup install nightly --profile minimal - name: Install clippy - run: rustup component add clippy + run: rustup component add clippy --toolchain nightly - name: Lint Code in Detectors run: | - cd detectors - cargo clippy --all-targets --all-features -- -D warnings + cd detectors && cargo clippy --all-targets --all-features -- -D warnings - name: Lint Code in Test Cases run: | From fac155ad8a27f1fbbc1383b45eedf3760fc80f59 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 18:17:11 -0300 Subject: [PATCH 06/93] Update general rust --- .github/workflows/general-rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 8262b732..1ebbc16a 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -68,6 +68,9 @@ jobs: - name: Install clippy run: rustup component add clippy --toolchain nightly + - name: Install dylint-link + run: cargo install dylint-link + - name: Lint Code in Detectors run: | cd detectors && cargo clippy --all-targets --all-features -- -D warnings From a7e6760b3c68de96de5c2cd912a576669193952b Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 18:26:19 -0300 Subject: [PATCH 07/93] Update udeps CI error --- .github/workflows/general-rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 1ebbc16a..f3dd194f 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -103,6 +103,9 @@ jobs: - name: Install cargo-udeps run: cargo install cargo-udeps + - name: Install dylint-link + run: cargo install dylint-link + - name: Check Unused Dependencies in Detectors run: | cd detectors From 7f86b64851dc0244279d07b27b5001e2417264fe Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 18:52:43 -0300 Subject: [PATCH 08/93] Update deprecated github output --- .github/workflows/test-detectors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 15d7ca1a..cf5043da 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -63,7 +63,7 @@ jobs: - id: set-matrix run: | - echo "::set-output name=matrix::$(find test-cases -mindepth 1 -maxdepth 1 -type d -printf '"%f", ' | sed 's/, $//')" + echo "name=matrix::$(find test-cases -mindepth 1 -maxdepth 1 -type d -printf '"%f", ' | sed 's/, $//')" >> $GITHUB_OUTPUT integration-tests: name: Integration Tests From 9fbd1b14a1ed6dd04e88cee6fdd8a4fc0e255f93 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 19:03:43 -0300 Subject: [PATCH 09/93] Edit udeps CI --- .github/workflows/general-rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index f3dd194f..56f17db5 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -100,6 +100,9 @@ jobs: - name: Install Rust nightly run: rustup install nightly --profile minimal + - name: Install rust-src, rustc-dev, and llvm-tools-preview + run: rustup component add rust-src rustc-dev llvm-tools-preview + - name: Install cargo-udeps run: cargo install cargo-udeps From d85550b1741da4291e30fd42515cb45a392a6c16 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 22:06:19 -0300 Subject: [PATCH 10/93] Update prepare-matrix --- .github/workflows/test-detectors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index cf5043da..af628046 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -63,7 +63,7 @@ jobs: - id: set-matrix run: | - echo "name=matrix::$(find test-cases -mindepth 1 -maxdepth 1 -type d -printf '"%f", ' | sed 's/, $//')" >> $GITHUB_OUTPUT + echo "matrix=$(find test-cases -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT integration-tests: name: Integration Tests From c17b583b739c949ea1627d3f8a9d964ea6e48754 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 22:21:51 -0300 Subject: [PATCH 11/93] Update integration test CI --- .github/workflows/test-detectors.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index af628046..05874de8 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -63,7 +63,7 @@ jobs: - id: set-matrix run: | - echo "matrix=$(find test-cases -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + echo "matrix=$(find test-cases -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT integration-tests: name: Integration Tests @@ -87,7 +87,6 @@ jobs: ~/.cargo target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - fail-on-cache-miss: true - name: Run integration test for a specific test case run: | From 44dda78aae37bfaa01dcbee8222a5e2f93a90bd3 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 22:37:58 -0300 Subject: [PATCH 12/93] Update CI --- .github/workflows/general-rust.yml | 22 ++--- .../test-detector-soroban-version.yml | 95 ------------------- .github/workflows/test-detectors.yml | 36 ++++++- 3 files changed, 41 insertions(+), 112 deletions(-) delete mode 100644 .github/workflows/test-detector-soroban-version.yml diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 56f17db5..858da53e 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -37,12 +37,11 @@ jobs: run: rustup component add rustfmt --toolchain nightly - name: Check Formatting in Detectors - run: | - cd detectors && cargo +nightly fmt -- --check -v + working-directory: detectors + run: cargo +nightly fmt -- --check -v - name: Check Formatting in Test Cases - run: | - find test-cases -name Cargo.toml -execdir cargo +nightly fmt -- --check -v \; + run: find test-cases -name Cargo.toml -execdir cargo +nightly fmt -- --check -v \; clippy: name: Lint with Clippy @@ -72,12 +71,11 @@ jobs: run: cargo install dylint-link - name: Lint Code in Detectors - run: | - cd detectors && cargo clippy --all-targets --all-features -- -D warnings + working-directory: detectors + run: cargo clippy --all-targets --all-features -- -D warnings - name: Lint Code in Test Cases - run: | - find test-cases -name Cargo.toml -execdir cargo clippy --all-targets --all-features -- -D warnings \; + run: find test-cases -name Cargo.toml -execdir cargo clippy --all-targets --all-features -- -D warnings \; udeps: name: Check Unused Dependencies with cargo-udeps @@ -110,10 +108,8 @@ jobs: run: cargo install dylint-link - name: Check Unused Dependencies in Detectors - run: | - cd detectors - cargo +nightly udeps --all-targets + working-directory: detectors + run: cargo +nightly udeps --all-targets - name: Check Unused Dependencies in Test Cases - run: | - find test-cases -name Cargo.toml -execdir cargo +nightly udeps --all-targets \; + run: find test-cases -name Cargo.toml -execdir cargo +nightly udeps --all-targets \; diff --git a/.github/workflows/test-detector-soroban-version.yml b/.github/workflows/test-detector-soroban-version.yml deleted file mode 100644 index d4728229..00000000 --- a/.github/workflows/test-detector-soroban-version.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Test Detectors - -on: - push: - branches: - - "main" - paths: - - "apps/cargo-scout-audit/**" - - "detectors/**" - - "test-cases/**" - - "Makefile" - pull_request: - paths: - - "apps/cargo-scout-audit/**" - - "detectors/**" - - "test-cases/**" - - "Makefile" - workflow_dispatch: - -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: full - -jobs: - build: - name: Build - strategy: - matrix: - os: - - ubuntu-latest - - macos-latest - runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Cache cargo-scout dependencies - id: cache-cargo-scout-dependencies - uses: actions/cache@v3 - with: - path: | - ~/.cargo - apps/cargo-scout-audit/target - detectors/target - detectors/Cargo.lock - key: ${{ runner.os }}-cargo-scout-dependencies-${{ github.run_id }} - - - name: Install Rust nightly-2023-09-29 - run: rustup install nightly-2023-09-29 --profile minimal - - - name: Install dylint-link - run: cargo install dylint-link - - - name: Compile cargo-scout-audit tests - working-directory: apps/cargo-scout-audit - run: cargo test --no-run - - - name: Compile detectors - working-directory: detectors - run: cargo build --release - - test: - name: Test - needs: build - strategy: - matrix: - os: - - ubuntu-latest - - macos-latest - test: - [ - "soroban-version", - ] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Cache cargo-scout dependencies - id: cache-cargo-scout-dependencies - uses: actions/cache@v3 - with: - path: | - ~/.cargo - apps/cargo-scout-audit/target - detectors/target - detectors/Cargo.lock - key: ${{ runner.os }}-cargo-scout-dependencies-${{ github.run_id }} - fail-on-cache-miss: true - - - name: Run tests - working-directory: apps/cargo-scout-audit - env: - INTEGRATION_TESTS_TO_RUN: ${{ matrix.test }} - run: cargo test -- --nocapture diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 05874de8..100dc841 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -65,7 +65,7 @@ jobs: run: | echo "matrix=$(find test-cases -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT - integration-tests: + unit-tests: name: Integration Tests needs: [build, prepare-test-matrix] strategy: @@ -89,6 +89,34 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run integration test for a specific test case - run: | - cd ${{ matrix.test-case }} - cargo test + working-directory: test-cases/${{ matrix.test-case }} + run: cargo test + + integration-tests: + name: Integration Tests + needs: [build, prepare-test-matrix] + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + test-case: ${{fromJson(needs.prepare-test-matrix.outputs.matrix)}} + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Cache cargo-scout dependencies + id: cache-cargo-scout-dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cargo + target + key: ${{ runner.os }}-cargo-scout-dependencies-${{ github.run_id }} + fail-on-cache-miss: true + + - name: Run integration test for a specific test case + working-directory: test-cases/${{ matrix.test-case }} + run: cargo test --features integration-tests From 15ef379476cc8adceed14d83175dfd1551e77acf Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 25 Mar 2024 22:55:56 -0300 Subject: [PATCH 13/93] Edit CI --- .github/workflows/test-detectors.yml | 41 +++++----------------------- 1 file changed, 7 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 100dc841..b4daeba6 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -32,13 +32,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Cache cargo-scout dependencies - id: cache-cargo-scout-dependencies + - name: Cache cargo dependencies uses: actions/cache@v4 with: path: | ~/.cargo - key: ${{ runner.os }}-cargo-scout-dependencies-${{ github.run_id }} + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- - name: Update Rust Toolchain run: rustup update @@ -63,7 +65,7 @@ jobs: - id: set-matrix run: | - echo "matrix=$(find test-cases -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + echo "matrix=$(find test-cases -name Cargo.toml -exec dirname {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT unit-tests: name: Integration Tests @@ -89,34 +91,5 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run integration test for a specific test case - working-directory: test-cases/${{ matrix.test-case }} + working-directory: ${{ matrix.test-case }} run: cargo test - - integration-tests: - name: Integration Tests - needs: [build, prepare-test-matrix] - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - macos-latest - test-case: ${{fromJson(needs.prepare-test-matrix.outputs.matrix)}} - runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Cache cargo-scout dependencies - id: cache-cargo-scout-dependencies - uses: actions/cache@v3 - with: - path: | - ~/.cargo - target - key: ${{ runner.os }}-cargo-scout-dependencies-${{ github.run_id }} - fail-on-cache-miss: true - - - name: Run integration test for a specific test case - working-directory: test-cases/${{ matrix.test-case }} - run: cargo test --features integration-tests From 2cd26cf0d3d98fb5c726c96043bad053c1d65fda Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 09:21:31 -0300 Subject: [PATCH 14/93] Update CI to run based on detectors --- .github/workflows/general-rust.yml | 2 +- .github/workflows/test-detectors.yml | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 858da53e..931f583a 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -78,7 +78,7 @@ jobs: run: find test-cases -name Cargo.toml -execdir cargo clippy --all-targets --all-features -- -D warnings \; udeps: - name: Check Unused Dependencies with cargo-udeps + name: Check Unused Dependencies runs-on: ubuntu-latest steps: diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index b4daeba6..a8c1b661 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -57,6 +57,7 @@ jobs: prepare-test-matrix: name: Prepare Test Matrix runs-on: ubuntu-latest + needs: build outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: @@ -64,11 +65,12 @@ jobs: uses: actions/checkout@v4 - id: set-matrix + working-directory: test-cases run: | - echo "matrix=$(find test-cases -name Cargo.toml -exec dirname {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + echo "matrix=$(find . -mindepth 1 -maxdepth 1 | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT - unit-tests: - name: Integration Tests + test: + name: Test detector needs: [build, prepare-test-matrix] strategy: fail-fast: false @@ -76,7 +78,7 @@ jobs: os: - ubuntu-latest - macos-latest - test-case: ${{fromJson(needs.prepare-test-matrix.outputs.matrix)}} + detector: ${{fromJson(needs.prepare-test-matrix.outputs.matrix)}} runs-on: ${{ matrix.os }} steps: - name: Checkout repository @@ -91,5 +93,7 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run integration test for a specific test case - working-directory: ${{ matrix.test-case }} - run: cargo test + working-directory: test-cases + run: | + cd ${{ matrix.detector }} + cargo test From d1ae929739f22c9d9cdfc934dc16c7bcaf0f79e3 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 09:27:16 -0300 Subject: [PATCH 15/93] Update unit test CI --- .github/workflows/test-detectors.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index a8c1b661..eae5e7bb 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -92,8 +92,9 @@ jobs: target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Run integration test for a specific test case + - name: Run unit tests for a specific detector working-directory: test-cases run: | cd ${{ matrix.detector }} - cargo test + find . -name Cargo.toml -execdir cargo test \; + From 1b16486586abfe80caf636e2c4724a843d4a4c3b Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 09:48:57 -0300 Subject: [PATCH 16/93] Edit CI to find by directory on tests --- .github/workflows/general-rust.yml | 5 ----- .github/workflows/test-detectors.yml | 19 +++++++------------ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 931f583a..6e163d3a 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -13,7 +13,6 @@ on: - "detectors/**" - "test-cases/**" - "Makefile" - workflow_dispatch: env: CARGO_TERM_COLOR: always @@ -107,9 +106,5 @@ jobs: - name: Install dylint-link run: cargo install dylint-link - - name: Check Unused Dependencies in Detectors - working-directory: detectors - run: cargo +nightly udeps --all-targets - - name: Check Unused Dependencies in Test Cases run: find test-cases -name Cargo.toml -execdir cargo +nightly udeps --all-targets \; diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index eae5e7bb..df52aaf9 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -13,7 +13,6 @@ on: - "detectors/**" - "test-cases/**" - "Makefile" - workflow_dispatch: env: CARGO_TERM_COLOR: always @@ -48,14 +47,11 @@ jobs: - name: Install Rust nightly run: rustup install nightly --profile minimal - - name: Install dylint and dylint-link - run: cargo +nightly install cargo-dylint dylint-link + - name: Install dylint, dylint-link and cargo-scout-audit + run: cargo +nightly install cargo-dylint dylint-link cargo-scout-audit - - name: Install cargo-scout-audit - run: cargo +nightly install cargo-scout-audit - - prepare-test-matrix: - name: Prepare Test Matrix + prepare-detector-matrix: + name: Prepare Detector Matrix runs-on: ubuntu-latest needs: build outputs: @@ -67,18 +63,18 @@ jobs: - id: set-matrix working-directory: test-cases run: | - echo "matrix=$(find . -mindepth 1 -maxdepth 1 | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + echo "matrix=$(find . -mindepth 1 -maxdepth 1 -type d | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT test: name: Test detector - needs: [build, prepare-test-matrix] + needs: [build, prepare-detector-matrix] strategy: fail-fast: false matrix: os: - ubuntu-latest - macos-latest - detector: ${{fromJson(needs.prepare-test-matrix.outputs.matrix)}} + detector: ${{fromJson(needs.prepare-detector-matrix.outputs.matrix)}} runs-on: ${{ matrix.os }} steps: - name: Checkout repository @@ -97,4 +93,3 @@ jobs: run: | cd ${{ matrix.detector }} find . -name Cargo.toml -execdir cargo test \; - From 6c23075ebaf43d3046f7baa1d0a688866c5950e2 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 10:28:51 -0300 Subject: [PATCH 17/93] Cache general rust and add setup step --- .github/workflows/general-rust.yml | 70 +++++++++++++++++++----------- 1 file changed, 45 insertions(+), 25 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 6e163d3a..c514b9b9 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -7,31 +7,64 @@ on: paths: - "detectors/**" - "test-cases/**" - - "Makefile" pull_request: paths: - "detectors/**" - "test-cases/**" - - "Makefile" env: CARGO_TERM_COLOR: always jobs: - format: - name: Check Rust Format + setup: + name: Setup runs-on: ubuntu-latest steps: - name: Checkout Code uses: actions/checkout@v4 + - name: Cache Rust Tools and Targets + uses: actions/cache@v4 + with: + path: | + ~/.cargo + test-cases/**/target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + - name: Update Rust Toolchain run: rustup update - name: Install Rust nightly run: rustup install nightly --profile minimal + - name: Install dylint-link + run: cargo install dylint-link + + - name: Update cargo + run: cargo update + + format: + name: Check Rust Format + runs-on: ubuntu-latest + needs: setup + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Cache Rust Dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cargo + test-cases/**/target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + - name: Install rustfmt run: rustup component add rustfmt --toolchain nightly @@ -45,6 +78,7 @@ jobs: clippy: name: Lint with Clippy runs-on: ubuntu-latest + needs: setup steps: - name: Checkout Code @@ -55,20 +89,14 @@ jobs: with: path: | ~/.cargo + test-cases/**/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Update Rust Toolchain - run: rustup update - - - name: Install Rust nightly - run: rustup install nightly --profile minimal + restore-keys: | + ${{ runner.os }}-cargo- - name: Install clippy run: rustup component add clippy --toolchain nightly - - name: Install dylint-link - run: cargo install dylint-link - - name: Lint Code in Detectors working-directory: detectors run: cargo clippy --all-targets --all-features -- -D warnings @@ -79,6 +107,7 @@ jobs: udeps: name: Check Unused Dependencies runs-on: ubuntu-latest + needs: setup steps: - name: Checkout Code @@ -89,22 +118,13 @@ jobs: with: path: | ~/.cargo + test-cases/**/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Update Rust Toolchain - run: rustup update - - - name: Install Rust nightly - run: rustup install nightly --profile minimal - - - name: Install rust-src, rustc-dev, and llvm-tools-preview - run: rustup component add rust-src rustc-dev llvm-tools-preview + restore-keys: | + ${{ runner.os }}-cargo- - name: Install cargo-udeps run: cargo install cargo-udeps - - name: Install dylint-link - run: cargo install dylint-link - - name: Check Unused Dependencies in Test Cases run: find test-cases -name Cargo.toml -execdir cargo +nightly udeps --all-targets \; From e51eaa057a7e508a542a1295cd185d863d857e58 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 10:32:15 -0300 Subject: [PATCH 18/93] Fix CI --- .github/workflows/general-rust.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index c514b9b9..d661d28c 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -41,10 +41,7 @@ jobs: run: rustup install nightly --profile minimal - name: Install dylint-link - run: cargo install dylint-link - - - name: Update cargo - run: cargo update + run: cargo install dylint-link --force format: name: Check Rust Format @@ -124,7 +121,7 @@ jobs: ${{ runner.os }}-cargo- - name: Install cargo-udeps - run: cargo install cargo-udeps + run: cargo install cargo-udeps --force - name: Check Unused Dependencies in Test Cases run: find test-cases -name Cargo.toml -execdir cargo +nightly udeps --all-targets \; From af5b3d688f89f9bdbeaa5792f43e937beae3b09b Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 10:40:20 -0300 Subject: [PATCH 19/93] Cache rustup --- .github/workflows/general-rust.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index d661d28c..3e3ad7e9 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -29,6 +29,7 @@ jobs: with: path: | ~/.cargo + ~/.rustup test-cases/**/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | @@ -57,11 +58,15 @@ jobs: with: path: | ~/.cargo + ~/.rustup test-cases/**/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo- + - name: Use Rust nightly + run: rustup default nightly + - name: Install rustfmt run: rustup component add rustfmt --toolchain nightly @@ -86,6 +91,7 @@ jobs: with: path: | ~/.cargo + ~/.rustup test-cases/**/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | @@ -115,6 +121,7 @@ jobs: with: path: | ~/.cargo + ~/.rustup test-cases/**/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | From 38766db9ef5aa74fd6e18578bf5f9822104c1888 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 10:49:06 -0300 Subject: [PATCH 20/93] Update general rust --- .github/workflows/general-rust.yml | 68 +++++++++--------------------- 1 file changed, 20 insertions(+), 48 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 3e3ad7e9..88474296 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -16,57 +16,19 @@ env: CARGO_TERM_COLOR: always jobs: - setup: - name: Setup + format: + name: Check Rust Format runs-on: ubuntu-latest - steps: - name: Checkout Code uses: actions/checkout@v4 - - name: Cache Rust Tools and Targets - uses: actions/cache@v4 - with: - path: | - ~/.cargo - ~/.rustup - test-cases/**/target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- - - name: Update Rust Toolchain run: rustup update - name: Install Rust nightly run: rustup install nightly --profile minimal - - name: Install dylint-link - run: cargo install dylint-link --force - - format: - name: Check Rust Format - runs-on: ubuntu-latest - needs: setup - - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Cache Rust Dependencies - uses: actions/cache@v4 - with: - path: | - ~/.cargo - ~/.rustup - test-cases/**/target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- - - - name: Use Rust nightly - run: rustup default nightly - - name: Install rustfmt run: rustup component add rustfmt --toolchain nightly @@ -80,8 +42,6 @@ jobs: clippy: name: Lint with Clippy runs-on: ubuntu-latest - needs: setup - steps: - name: Checkout Code uses: actions/checkout@v4 @@ -94,8 +54,15 @@ jobs: ~/.rustup test-cases/**/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + + - name: Update Rust Toolchain + run: rustup update + + - name: Install Rust nightly + run: rustup install nightly --profile minimal + + - name: Install dylint-link + run: cargo install dylint-link --force - name: Install clippy run: rustup component add clippy --toolchain nightly @@ -110,8 +77,6 @@ jobs: udeps: name: Check Unused Dependencies runs-on: ubuntu-latest - needs: setup - steps: - name: Checkout Code uses: actions/checkout@v4 @@ -124,8 +89,15 @@ jobs: ~/.rustup test-cases/**/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + + - name: Update Rust Toolchain + run: rustup update + + - name: Install Rust nightly + run: rustup install nightly --profile minimal + + - name: Install dylint-link + run: cargo install dylint-link --force - name: Install cargo-udeps run: cargo install cargo-udeps --force From 72fb62e961630617f6710b71dededa0cfd8e9563 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 11:34:21 -0300 Subject: [PATCH 21/93] Cache all targets --- .github/workflows/general-rust.yml | 6 +++--- .github/workflows/test-detectors.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 88474296..b26a11f4 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -52,7 +52,7 @@ jobs: path: | ~/.cargo ~/.rustup - test-cases/**/target + **/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain @@ -87,7 +87,7 @@ jobs: path: | ~/.cargo ~/.rustup - test-cases/**/target + **/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain @@ -103,4 +103,4 @@ jobs: run: cargo install cargo-udeps --force - name: Check Unused Dependencies in Test Cases - run: find test-cases -name Cargo.toml -execdir cargo +nightly udeps --all-targets \; + run: find test-cases -name Cargo.toml -execdir bash -c 'cargo +nightly udeps --all-targets || exit 255' \; diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index df52aaf9..31324092 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -36,7 +36,7 @@ jobs: with: path: | ~/.cargo - target + **/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo- @@ -85,7 +85,7 @@ jobs: with: path: | ~/.cargo - target + **/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run unit tests for a specific detector From 1d30ebf0d5e485bb2cfa5d1937d61b55283743a0 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 12:22:36 -0300 Subject: [PATCH 22/93] Update udeps ci --- .github/workflows/general-rust.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index b26a11f4..4d35287c 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -103,4 +103,6 @@ jobs: run: cargo install cargo-udeps --force - name: Check Unused Dependencies in Test Cases - run: find test-cases -name Cargo.toml -execdir bash -c 'cargo +nightly udeps --all-targets || exit 255' \; + run: | + set -e + find test-cases -name Cargo.toml -execdir bash -c 'cargo +nightly udeps --all-targets' \; From b53b2d08b1ee038b72965a36ea506da729d2d760 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 13:17:22 -0300 Subject: [PATCH 23/93] Add test-cases structure validation --- .github/workflows/test-detectors.yml | 16 +++ scripts/validate-detectors.py | 120 ++++++++++++++++++ .../Cargo.toml | 0 .../src/lib.rs | 0 4 files changed, 136 insertions(+) create mode 100644 scripts/validate-detectors.py rename test-cases/soroban-version/soroban-version-1/{remediated-example.skip => remediated-example}/Cargo.toml (100%) rename test-cases/soroban-version/soroban-version-1/{remediated-example.skip => remediated-example}/src/lib.rs (100%) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 31324092..dfdfb217 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -19,8 +19,24 @@ env: RUST_BACKTRACE: full jobs: + validate-detectors: + name: Validate + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - name: Validate detectors + run: python scripts/validate-detectors.py + build: name: Build + needs: validate-detectors strategy: matrix: os: diff --git a/scripts/validate-detectors.py b/scripts/validate-detectors.py new file mode 100644 index 00000000..df858353 --- /dev/null +++ b/scripts/validate-detectors.py @@ -0,0 +1,120 @@ +import os +import sys +import re +from fuzzywuzzy import process + + +def is_rust_project(dir_path): + """Check if a directory contains a Rust project with a Cargo.toml and src/lib.rs.""" + errors = [] + has_cargo_toml = os.path.isfile(os.path.join(dir_path, "Cargo.toml")) + has_lib_rs = os.path.isfile(os.path.join(dir_path, "src", "lib.rs")) + + if not has_cargo_toml: + errors.append(f"Missing Cargo.toml in {dir_path}.") + if not has_lib_rs: + errors.append(f"Missing src/lib.rs in {dir_path}.") + + return errors + + +def check_for_extra_files(directory): + """Ensure there are no unexpected files in a given directory.""" + errors = [] + for item in os.listdir(directory): + item_path = os.path.join(directory, item) + if os.path.isfile(item_path): + errors.append(f"Unexpected file found: {item_path}") + return errors + + +def validate_naming_convention(example, detector_name): + """Validate the naming convention of the example.""" + if not re.match(f"{re.escape(detector_name)}-\\d+$", example): + return [ + f"Naming issue for '{example}' in {detector_name}: Expected format is {detector_name}-[number]." + ] + return [] + + +def validate_example_structure(example_path, example_name): + """Ensure each example has the required subdirectories with detailed errors.""" + errors = [] + expected_subs = ["vulnerable-example", "remediated-example"] + actual_subs = [ + d + for d in os.listdir(example_path) + if os.path.isdir(os.path.join(example_path, d)) + ] + + for expected_sub in expected_subs: + if expected_sub not in actual_subs: + error_msg = f"Directory '{expected_sub}' not found in {example_path}." + closest_match = process.extractOne( + expected_sub, actual_subs, score_cutoff=80 + ) + if closest_match: + error_msg += f" A similar directory exists: '{closest_match[0]}', please rename it to '{expected_sub}'." + errors.append(error_msg) + else: + sub_errors = is_rust_project(os.path.join(example_path, expected_sub)) + for error in sub_errors: + errors.append(error) + + return errors + + +def validate_examples(detector_path, examples): + """Validate the structure and naming convention of examples.""" + errors = [] + detector_name = os.path.basename(detector_path) + example_suffixes = set() + + for example in examples: + example_path = os.path.join(detector_path, example) + errors.extend(check_for_extra_files(example_path)) + errors.extend(validate_naming_convention(example, detector_name)) + suffix = example.split("-")[-1] + if suffix in example_suffixes: + errors.append( + f"Duplicate example number found in {detector_name}: {example}" + ) + else: + example_suffixes.add(suffix) + errors.extend(validate_example_structure(example_path, example)) + + return errors + + +def validate_detectors(base_path): + """Validate the structure of the test-cases directory.""" + all_errors = [] + + for detector in os.listdir(base_path): + detector_path = os.path.join(base_path, detector) + if detector == "README.md" or not os.path.isdir(detector_path): + continue + + all_errors.extend(check_for_extra_files(detector_path)) + examples = [ + e + for e in os.listdir(detector_path) + if os.path.isdir(os.path.join(detector_path, e)) + ] + if not examples: + all_errors.append(f"No examples found in {detector}.") + else: + all_errors.extend(validate_examples(detector_path, examples)) + + if all_errors: + print("Validation errors found:") + for error in all_errors: + print(f"* {error}") + sys.exit(1) + else: + print("No validation errors found.") + + +if __name__ == "__main__": + BASE_PATH = "test-cases" + validate_detectors(BASE_PATH) diff --git a/test-cases/soroban-version/soroban-version-1/remediated-example.skip/Cargo.toml b/test-cases/soroban-version/soroban-version-1/remediated-example/Cargo.toml similarity index 100% rename from test-cases/soroban-version/soroban-version-1/remediated-example.skip/Cargo.toml rename to test-cases/soroban-version/soroban-version-1/remediated-example/Cargo.toml diff --git a/test-cases/soroban-version/soroban-version-1/remediated-example.skip/src/lib.rs b/test-cases/soroban-version/soroban-version-1/remediated-example/src/lib.rs similarity index 100% rename from test-cases/soroban-version/soroban-version-1/remediated-example.skip/src/lib.rs rename to test-cases/soroban-version/soroban-version-1/remediated-example/src/lib.rs From 34b88e56d4e4cc66a1a4091bb60328eaa92de84d Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 13:19:23 -0300 Subject: [PATCH 24/93] Add dependencies --- .github/workflows/test-detectors.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index dfdfb217..389546c5 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -31,6 +31,9 @@ jobs: with: python-version: "3.9" + - name: Install dependencies + run: pip install fuzzywuzzy + - name: Validate detectors run: python scripts/validate-detectors.py From fa329c479ad6f4e3201a6632c8cb11cb0508008e Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 13:48:56 -0300 Subject: [PATCH 25/93] Remove target caching due to memory constraints --- .github/workflows/general-rust.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 4d35287c..101f6548 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -52,7 +52,6 @@ jobs: path: | ~/.cargo ~/.rustup - **/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain @@ -87,7 +86,6 @@ jobs: path: | ~/.cargo ~/.rustup - **/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain From f832fdfb9e0f4baa8f756d2ef939b7a8e32638c5 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 19:17:08 -0300 Subject: [PATCH 26/93] Update udeps CI --- .github/workflows/general-rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 101f6548..8c05eb61 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -103,4 +103,4 @@ jobs: - name: Check Unused Dependencies in Test Cases run: | set -e - find test-cases -name Cargo.toml -execdir bash -c 'cargo +nightly udeps --all-targets' \; + find test-cases -name Cargo.toml -execdir bash -c 'cargo update && cargo +nightly udeps --all-targets || exit 255' \; From b7ba07406c3c36fb8d900c634ca16dd2137b0166 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 19:41:02 -0300 Subject: [PATCH 27/93] Try fix exit on find --- .github/workflows/general-rust.yml | 10 ++++------ .github/workflows/test-detectors.yml | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 8c05eb61..a2f43512 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -36,8 +36,8 @@ jobs: working-directory: detectors run: cargo +nightly fmt -- --check -v - - name: Check Formatting in Test Cases - run: find test-cases -name Cargo.toml -execdir cargo +nightly fmt -- --check -v \; + - name: Format Code in Test Cases + run: find test-cases -name Cargo.toml -print0 | xargs -0 -I{} bash -c 'cd "$(dirname {})" && cargo +nightly fmt -- --check -v || exit 255' clippy: name: Lint with Clippy @@ -71,7 +71,7 @@ jobs: run: cargo clippy --all-targets --all-features -- -D warnings - name: Lint Code in Test Cases - run: find test-cases -name Cargo.toml -execdir cargo clippy --all-targets --all-features -- -D warnings \; + run: find test-cases -name Cargo.toml -print0 | xargs -0 -I {} sh -c 'cd $(dirname {}) && cargo clippy --all-targets --all-features -- -D warnings || exit 255' udeps: name: Check Unused Dependencies @@ -101,6 +101,4 @@ jobs: run: cargo install cargo-udeps --force - name: Check Unused Dependencies in Test Cases - run: | - set -e - find test-cases -name Cargo.toml -execdir bash -c 'cargo update && cargo +nightly udeps --all-targets || exit 255' \; + run: find test-cases -name Cargo.toml -print0 | xargs -0 -I{} bash -c 'cd "$(dirname {})" && cargo update && cargo +nightly udeps --all-targets || exit 255' diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 389546c5..cee490c2 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -111,4 +111,4 @@ jobs: working-directory: test-cases run: | cd ${{ matrix.detector }} - find . -name Cargo.toml -execdir cargo test \; + find . -name Cargo.toml -print0 | xargs -0 -I{} bash -c 'cd "$(dirname {})" && cargo test || exit 255' From 622c1fa68c1f967ae085c4f3ee83a929028599f3 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 20:46:43 -0300 Subject: [PATCH 28/93] Use python for clippy and fmt --- .github/workflows/general-rust.yml | 26 ++++++++++---------- scripts/run-clippy.py | 38 ++++++++++++++++++++++++++++++ scripts/run-fmt.py | 38 ++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 12 deletions(-) create mode 100644 scripts/run-clippy.py create mode 100644 scripts/run-fmt.py diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index a2f43512..7bbcd19d 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -23,6 +23,11 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + - name: Update Rust Toolchain run: rustup update @@ -32,12 +37,8 @@ jobs: - name: Install rustfmt run: rustup component add rustfmt --toolchain nightly - - name: Check Formatting in Detectors - working-directory: detectors - run: cargo +nightly fmt -- --check -v - - - name: Format Code in Test Cases - run: find test-cases -name Cargo.toml -print0 | xargs -0 -I{} bash -c 'cd "$(dirname {})" && cargo +nightly fmt -- --check -v || exit 255' + - name: Check Format + run: python scripts/run-fmt.py clippy: name: Lint with Clippy @@ -46,6 +47,11 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + - name: Cache Rust Dependencies uses: actions/cache@v4 with: @@ -66,12 +72,8 @@ jobs: - name: Install clippy run: rustup component add clippy --toolchain nightly - - name: Lint Code in Detectors - working-directory: detectors - run: cargo clippy --all-targets --all-features -- -D warnings - - - name: Lint Code in Test Cases - run: find test-cases -name Cargo.toml -print0 | xargs -0 -I {} sh -c 'cd $(dirname {}) && cargo clippy --all-targets --all-features -- -D warnings || exit 255' + - name: Lint with Clippy + run: python scripts/run-clippy.py udeps: name: Check Unused Dependencies diff --git a/scripts/run-clippy.py b/scripts/run-clippy.py new file mode 100644 index 00000000..10df80ca --- /dev/null +++ b/scripts/run-clippy.py @@ -0,0 +1,38 @@ +import os +import subprocess + +RED = '\033[91m' +GREEN = '\033[92m' +ENDC = '\033[0m' + +def run_clippy(directories): + errors = [] + for directory in directories: + print(f"/n{GREEN}Running clippy in {directory}:{ENDC}") + for root, _, files in os.walk(directory): + if 'Cargo.toml' in files: + print(f"Running clippy in: {root}") + result = subprocess.run(['cargo', 'clippy', '--all-targets', '--all-features', '--', '-D', 'warnings'], cwd=root, capture_output=True, text=True) + if result.returncode != 0: + print(f"\n{RED}Clippy issues found in: {root}{ENDC}\n") + error_message = result.stderr.strip() + for line in error_message.split('\n'): + print(f"| {RED}{line}{ENDC}") + print("\n") + errors.append(root) + return errors + +def print_clippy_errors(errors): + if errors: + print(f"{RED}\nClippy errors detected in the following directories:{ENDC}") + for error_dir in errors: + print(f"• {error_dir}") + else: + print(f"{GREEN}\nNo clippy issues found across all directories.{ENDC}") + +if __name__ == "__main__": + directories = ['test-cases', 'detectors'] + errors = run_clippy(directories) + print_clippy_errors(errors) + if errors: + exit(1) diff --git a/scripts/run-fmt.py b/scripts/run-fmt.py new file mode 100644 index 00000000..e4fbe0af --- /dev/null +++ b/scripts/run-fmt.py @@ -0,0 +1,38 @@ +import os +import subprocess + +RED = '\033[91m' +GREEN = '\033[92m' +ENDC = '\033[0m' + +def run_fmt(directories): + errors = [] + for directory in directories: + print(f"\n{GREEN}Checking format in {directory}:{ENDC}") + for root, _, files in os.walk(directory): + if 'Cargo.toml' in files: + print(f"Checking format in: {root}") + result = subprocess.run(['cargo', '+nightly', 'fmt', '--', '--check', '-v'], cwd=root, capture_output=True, text=True) + if result.returncode != 0: + print(f"\n{RED}Formatting issues found in: {root}{ENDC}\n") + error_message = result.stdout.strip() + for line in error_message.split('\n'): + print(f"| {line}") + print("\n") + errors.append(root) + return errors + +def print_fmt_errors(errors): + if errors: + print(f"{RED}\nFormatting errors detected in the following directories:{ENDC}") + for error_dir in errors: + print(f"• {error_dir}") + else: + print(f"{GREEN}\nNo formatting issues found across all directories.{ENDC}") + +if __name__ == "__main__": + directories = ['test-cases', 'detectors'] + errors = run_fmt(directories) + print_fmt_errors(errors) + if errors: + exit(1) From cde130bc26b276dee4b6da2bbb0e51aeaa2c502e Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 26 Mar 2024 20:52:26 -0300 Subject: [PATCH 29/93] Unbuffer python output --- .github/workflows/general-rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 7bbcd19d..fafee21d 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -14,6 +14,7 @@ on: env: CARGO_TERM_COLOR: always + PYTHONUNBUFFERED: 1 jobs: format: From c3afb9b9d3d8bab948f53c46ca323b8b11ae9930 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 09:54:06 -0300 Subject: [PATCH 30/93] Edit udeps ci --- .github/workflows/general-rust.yml | 14 ++++++----- scripts/run-clippy.py | 4 ++-- scripts/run-udeps.py | 38 ++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 scripts/run-udeps.py diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index fafee21d..7dfcec14 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -83,6 +83,11 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + - name: Cache Rust Dependencies uses: actions/cache@v4 with: @@ -98,10 +103,7 @@ jobs: run: rustup install nightly --profile minimal - name: Install dylint-link - run: cargo install dylint-link --force - - - name: Install cargo-udeps - run: cargo install cargo-udeps --force + run: cargo install dylint-link cargo-udeps --force - - name: Check Unused Dependencies in Test Cases - run: find test-cases -name Cargo.toml -print0 | xargs -0 -I{} bash -c 'cd "$(dirname {})" && cargo update && cargo +nightly udeps --all-targets || exit 255' + - name: Find unused dependencies + run: python scripts/run-udeps.py diff --git a/scripts/run-clippy.py b/scripts/run-clippy.py index 10df80ca..8b4b5ce3 100644 --- a/scripts/run-clippy.py +++ b/scripts/run-clippy.py @@ -8,7 +8,7 @@ def run_clippy(directories): errors = [] for directory in directories: - print(f"/n{GREEN}Running clippy in {directory}:{ENDC}") + print(f"\n{GREEN}Running clippy in {directory}:{ENDC}") for root, _, files in os.walk(directory): if 'Cargo.toml' in files: print(f"Running clippy in: {root}") @@ -17,7 +17,7 @@ def run_clippy(directories): print(f"\n{RED}Clippy issues found in: {root}{ENDC}\n") error_message = result.stderr.strip() for line in error_message.split('\n'): - print(f"| {RED}{line}{ENDC}") + print(f"| {line}") print("\n") errors.append(root) return errors diff --git a/scripts/run-udeps.py b/scripts/run-udeps.py new file mode 100644 index 00000000..651f2bd8 --- /dev/null +++ b/scripts/run-udeps.py @@ -0,0 +1,38 @@ +import os +import subprocess + +RED = '\033[91m' +GREEN = '\033[92m' +ENDC = '\033[0m' + +def run_udeps(directories): + errors = [] + for directory in directories: + print(f"\n{GREEN}Checking unused dependencies in {directory}:{ENDC}") + for root, _, files in os.walk(directory): + if 'Cargo.toml' in files: + print(f"Checking unused dependencies in: {root}") + result = subprocess.run(['cargo', '+nightly', 'udeps', '--no-default-features'], cwd=root, capture_output=True, text=True) + if result.returncode != 0: + print(f"\n{RED}Unused dependencies found in: {root}{ENDC}\n") + error_message = result.stdout.strip() + for line in error_message.split('\n'): + print(f"| {line}") + print("\n") + errors.append(root) + return errors + +def print_udeps_errors(errors): + if errors: + print(f"{RED}\nUnused dependencies detected in the following directories:{ENDC}") + for error_dir in errors: + print(f"• {error_dir}") + else: + print(f"{GREEN}\nNo unused dependencies found across all directories.{ENDC}") + +if __name__ == "__main__": + directories = ['test-cases', 'detectors'] + errors = run_udeps(directories) + print_udeps_errors(errors) + if errors: + exit(1) From e82e50d66c65a49816c60ba9127b7021620c05c0 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 10:10:45 -0300 Subject: [PATCH 31/93] Test fix udeps ci --- scripts/run-udeps.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/run-udeps.py b/scripts/run-udeps.py index 651f2bd8..9e045236 100644 --- a/scripts/run-udeps.py +++ b/scripts/run-udeps.py @@ -12,10 +12,11 @@ def run_udeps(directories): for root, _, files in os.walk(directory): if 'Cargo.toml' in files: print(f"Checking unused dependencies in: {root}") - result = subprocess.run(['cargo', '+nightly', 'udeps', '--no-default-features'], cwd=root, capture_output=True, text=True) + subprocess.run(['cargo', 'update'], cwd=root) + result = subprocess.run(['cargo', '+nightly', 'udeps', '--no-default-features', '--frozen', '--backend=save-analysis'], cwd=root, capture_output=True, text=True) if result.returncode != 0: print(f"\n{RED}Unused dependencies found in: {root}{ENDC}\n") - error_message = result.stdout.strip() + error_message = result.stderr.strip() for line in error_message.split('\n'): print(f"| {line}") print("\n") From b1131336c559321eaa2d3a6661c2da1b966d943c Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 10:57:02 -0300 Subject: [PATCH 32/93] frozen -> locked on udeps ci --- scripts/run-udeps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-udeps.py b/scripts/run-udeps.py index 9e045236..2c4d7c16 100644 --- a/scripts/run-udeps.py +++ b/scripts/run-udeps.py @@ -13,7 +13,7 @@ def run_udeps(directories): if 'Cargo.toml' in files: print(f"Checking unused dependencies in: {root}") subprocess.run(['cargo', 'update'], cwd=root) - result = subprocess.run(['cargo', '+nightly', 'udeps', '--no-default-features', '--frozen', '--backend=save-analysis'], cwd=root, capture_output=True, text=True) + result = subprocess.run(['cargo', '+nightly', 'udeps', '--no-default-features', '--locked', '--backend=save-analysis'], cwd=root, capture_output=True, text=True) if result.returncode != 0: print(f"\n{RED}Unused dependencies found in: {root}{ENDC}\n") error_message = result.stderr.strip() From f7fb77b4cc54273cfe8a9cd73e5cd3c83fb52ee1 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 11:33:54 -0300 Subject: [PATCH 33/93] Test udeps with macos --- .github/workflows/general-rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 7dfcec14..fb79a052 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -78,7 +78,7 @@ jobs: udeps: name: Check Unused Dependencies - runs-on: ubuntu-latest + runs-on: macos-latest steps: - name: Checkout Code uses: actions/checkout@v4 From 875f754d1c00424881126e64a388690c0b172304 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 12:55:40 -0300 Subject: [PATCH 34/93] Remove udeps step, try fix clippy warnings, add python for tests ci --- .github/workflows/general-rust.yml | 32 --------- .github/workflows/test-detectors.yml | 10 +-- scripts/run-clippy.py | 39 ++++++++--- scripts/run-fmt.py | 32 ++++++--- scripts/run-tests.py | 70 +++++++++++++++++++ .../vulnerable-example/src/lib.rs | 6 ++ .../remediated-example/src/lib.rs | 2 +- 7 files changed, 138 insertions(+), 53 deletions(-) create mode 100644 scripts/run-tests.py diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index fb79a052..df09d26f 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -75,35 +75,3 @@ jobs: - name: Lint with Clippy run: python scripts/run-clippy.py - - udeps: - name: Check Unused Dependencies - runs-on: macos-latest - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - - name: Cache Rust Dependencies - uses: actions/cache@v4 - with: - path: | - ~/.cargo - ~/.rustup - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Update Rust Toolchain - run: rustup update - - - name: Install Rust nightly - run: rustup install nightly --profile minimal - - - name: Install dylint-link - run: cargo install dylint-link cargo-udeps --force - - - name: Find unused dependencies - run: python scripts/run-udeps.py diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index cee490c2..4022d46d 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -99,6 +99,11 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + - name: Cache cargo dependencies uses: actions/cache@v4 with: @@ -108,7 +113,4 @@ jobs: key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run unit tests for a specific detector - working-directory: test-cases - run: | - cd ${{ matrix.detector }} - find . -name Cargo.toml -print0 | xargs -0 -I{} bash -c 'cd "$(dirname {})" && cargo test || exit 255' + run: python scripts/run-tests.py --detector=${{ matrix.detector }} diff --git a/scripts/run-clippy.py b/scripts/run-clippy.py index 8b4b5ce3..02d8b909 100644 --- a/scripts/run-clippy.py +++ b/scripts/run-clippy.py @@ -1,27 +1,49 @@ import os import subprocess +import time + +RED = "\033[91m" +GREEN = "\033[92m" +BLUE = "\033[94m" +ENDC = "\033[0m" -RED = '\033[91m' -GREEN = '\033[92m' -ENDC = '\033[0m' def run_clippy(directories): errors = [] for directory in directories: print(f"\n{GREEN}Running clippy in {directory}:{ENDC}") for root, _, files in os.walk(directory): - if 'Cargo.toml' in files: - print(f"Running clippy in: {root}") - result = subprocess.run(['cargo', 'clippy', '--all-targets', '--all-features', '--', '-D', 'warnings'], cwd=root, capture_output=True, text=True) + if "Cargo.toml" in files: + start_time = time.time() + result = subprocess.run( + [ + "cargo", + "clippy", + "--all-targets", + "--all-features", + "--", + "-D", + "warnings", + ], + cwd=root, + capture_output=True, + text=True, + ) + end_time = time.time() + elapsed_time = end_time - start_time + print( + f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed clippy check in: {root}." + ) if result.returncode != 0: print(f"\n{RED}Clippy issues found in: {root}{ENDC}\n") error_message = result.stderr.strip() - for line in error_message.split('\n'): + for line in error_message.split("\n"): print(f"| {line}") print("\n") errors.append(root) return errors + def print_clippy_errors(errors): if errors: print(f"{RED}\nClippy errors detected in the following directories:{ENDC}") @@ -30,8 +52,9 @@ def print_clippy_errors(errors): else: print(f"{GREEN}\nNo clippy issues found across all directories.{ENDC}") + if __name__ == "__main__": - directories = ['test-cases', 'detectors'] + directories = ["test-cases", "detectors"] errors = run_clippy(directories) print_clippy_errors(errors) if errors: diff --git a/scripts/run-fmt.py b/scripts/run-fmt.py index e4fbe0af..043106b1 100644 --- a/scripts/run-fmt.py +++ b/scripts/run-fmt.py @@ -1,27 +1,42 @@ import os import subprocess +import time +from datetime import datetime + +RED = "\033[91m" +GREEN = "\033[92m" +BLUE = "\033[94m" +ENDC = "\033[0m" -RED = '\033[91m' -GREEN = '\033[92m' -ENDC = '\033[0m' def run_fmt(directories): errors = [] for directory in directories: print(f"\n{GREEN}Checking format in {directory}:{ENDC}") for root, _, files in os.walk(directory): - if 'Cargo.toml' in files: - print(f"Checking format in: {root}") - result = subprocess.run(['cargo', '+nightly', 'fmt', '--', '--check', '-v'], cwd=root, capture_output=True, text=True) + if "Cargo.toml" in files: + start_time = time.time() + result = subprocess.run( + ["cargo", "+nightly", "fmt", "--", "--check", "-v"], + cwd=root, + capture_output=True, + text=True, + ) + end_time = time.time() + elapsed_time = end_time - start_time + print( + f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed format check in: {root}." + ) if result.returncode != 0: print(f"\n{RED}Formatting issues found in: {root}{ENDC}\n") error_message = result.stdout.strip() - for line in error_message.split('\n'): + for line in error_message.split("\n"): print(f"| {line}") print("\n") errors.append(root) return errors + def print_fmt_errors(errors): if errors: print(f"{RED}\nFormatting errors detected in the following directories:{ENDC}") @@ -30,8 +45,9 @@ def print_fmt_errors(errors): else: print(f"{GREEN}\nNo formatting issues found across all directories.{ENDC}") + if __name__ == "__main__": - directories = ['test-cases', 'detectors'] + directories = ["test-cases", "detectors"] errors = run_fmt(directories) print_fmt_errors(errors) if errors: diff --git a/scripts/run-tests.py b/scripts/run-tests.py new file mode 100644 index 00000000..774db322 --- /dev/null +++ b/scripts/run-tests.py @@ -0,0 +1,70 @@ +import os +import subprocess +import argparse +import time + +RED = "\033[91m" +GREEN = "\033[92m" +BLUE = "\033[94m" +ENDC = "\033[0m" + + +def run_tests(detector): + errors = [] + directory = os.path.join("test-cases", detector) + print(f"\n{GREEN}Performing tests in {directory}:{ENDC}") + if os.path.exists(directory): + for root, _, files in os.walk(directory): + if "Cargo.toml" in files: + start_time = time.time() + result = subprocess.run( + ["cargo", "test", "--all-features", "--all"], + cwd=root, + capture_output=True, + text=True, + ) + end_time = time.time() + elapsed_time = end_time - start_time + print( + f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed test in: {root}." + ) + if result.returncode != 0: + print(f"\n{RED}Test error found in: {root}{ENDC}\n") + error_message = result.stdout.strip() + for line in error_message.split("\n"): + print(f"| {line}") + print("\n") + errors.append(root) + else: + print( + f"{RED}The specified detector directory does not exist: {directory}{ENDC}" + ) + return errors + + +def print_tests_errors(errors): + if errors: + print(f"{RED}\nErrors detected in the following directories:{ENDC}") + for error_dir in errors: + print(f"• {error_dir}") + else: + print(f"{GREEN}\nNo errors found in the specified directory.{ENDC}") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description="Run tests for a specific detector.") + parser.add_argument( + "--detector", + type=str, + help='The detector to run tests for, e.g., "./unsafe-unwrap"', + ) + + args = parser.parse_args() + + if args.detector: + errors = run_tests(args.detector.strip("./")) + print_tests_errors(errors) + if errors: + exit(1) + else: + print(f"{RED}No detector specified. Please provide a detector argument.{ENDC}") diff --git a/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/src/lib.rs b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/src/lib.rs index 9f8aa0df..56c855ba 100644 --- a/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/src/lib.rs +++ b/test-cases/avoid-core-mem-forget/avoid-core-mem-forget-1/vulnerable-example/src/lib.rs @@ -11,6 +11,12 @@ pub struct WithoutCopy { pub b: u64, } +impl Drop for WithoutCopy { + fn drop(&mut self) { + // Prevent clippy warning + } +} + #[contractimpl] impl AvoidCoreMemForget { pub fn forget_something(n: WithoutCopy) -> u64 { diff --git a/test-cases/divide-before-multiply/divide-before-multiply-3/remediated-example/src/lib.rs b/test-cases/divide-before-multiply/divide-before-multiply-3/remediated-example/src/lib.rs index ef8b3125..b4115335 100644 --- a/test-cases/divide-before-multiply/divide-before-multiply-3/remediated-example/src/lib.rs +++ b/test-cases/divide-before-multiply/divide-before-multiply-3/remediated-example/src/lib.rs @@ -7,7 +7,7 @@ pub struct DivideBeforeMultiply; #[contractimpl] impl DivideBeforeMultiply { pub fn hybrid_split_profit(percentage: u64, total_profit: u64) -> Option { - Some((percentage * total_profit).checked_div(100)?) + (percentage * total_profit).checked_div(100) } } From c858551b466820b803fb43781182bf166c84ba5b Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 13:31:25 -0300 Subject: [PATCH 35/93] Delete unused scripts, add make ci, unbuffer python in tests --- .github/workflows/test-detectors.yml | 3 +- Makefile | 38 ++++-------- scripts/check-ci-detectors-to-test.py | 26 -------- scripts/check-detectors-names-match-folder.py | 49 --------------- scripts/check-detectors-repeated-names.py | 59 ------------------ scripts/check-detectors-underscore-names.py | 47 --------------- scripts/list-cargo-directories.sh | 9 --- scripts/new-test-case.py | 35 ----------- scripts/publish-to-crates-io.py | 60 ------------------- scripts/run-cargo-clippy.sh | 22 ------- scripts/run-cargo-fmt.sh | 37 ------------ scripts/run-cargo-test.sh | 22 ------- 12 files changed, 14 insertions(+), 393 deletions(-) delete mode 100644 scripts/check-ci-detectors-to-test.py delete mode 100644 scripts/check-detectors-names-match-folder.py delete mode 100644 scripts/check-detectors-repeated-names.py delete mode 100644 scripts/check-detectors-underscore-names.py delete mode 100755 scripts/list-cargo-directories.sh delete mode 100644 scripts/new-test-case.py delete mode 100644 scripts/publish-to-crates-io.py delete mode 100755 scripts/run-cargo-clippy.sh delete mode 100755 scripts/run-cargo-fmt.sh delete mode 100755 scripts/run-cargo-test.sh diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 4022d46d..c7a905a4 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -7,16 +7,15 @@ on: paths: - "detectors/**" - "test-cases/**" - - "Makefile" pull_request: paths: - "detectors/**" - "test-cases/**" - - "Makefile" env: CARGO_TERM_COLOR: always RUST_BACKTRACE: full + PYTHONUNBUFFERED: 1 jobs: validate-detectors: diff --git a/Makefile b/Makefile index ef1eec12..a838e462 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,19 @@ -ci: fmt lint test -ci-check: fmt-check lint test - -fmt: fmt-rust -fmt-check: fmt-rust-check -lint: lint-cargo-scout-audit lint-detectors lint-scout-audit-internal +ci: fmt-rust lint test +ci-no-test: fmt-rust lint fmt-rust: @echo "Formatting Rust code..." - @./scripts/list-cargo-directories.sh | ./scripts/run-cargo-fmt.sh - -fmt-rust-check: - @echo "Checking Rust code formatting..." - @./scripts/list-cargo-directories.sh | ./scripts/run-cargo-fmt.sh --check - -lint-cargo-scout-audit: - @echo "Linting cargo-scout-audit..." - @cd apps/cargo-scout-audit && cargo clippy --all --all-features --quiet -- -D warnings - -lint-detectors: - @echo "Linting detectors..." - @cd detectors && ../scripts/list-cargo-directories.sh | ../scripts/run-cargo-clippy.sh + @python3 scripts/run-fmt.py -lint-scout-audit-internal: - @echo "Linting scout-audit-internal..." - @cd scout-audit-internal && cargo clippy --all --all-features --quiet -- -D warnings +lint: + @echo "Linting detectors and test-cases..." + @python3 scripts/run-clippy.py test: - @echo "Running tests..." - @cd apps/cargo-scout-audit && cargo test --all --all-features -- --nocapture - @cd test-cases && ../scripts/list-cargo-directories.sh | ../scripts/run-cargo-test.sh + @echo "Generating test matrix and running tests..." + @for detector in test-cases/*; do \ + if [ -d "$$detector" ]; then \ + detector_name=$$(basename $$detector); \ + python3 scripts/run-tests.py --detector=$$detector_name; \ + fi \ + done diff --git a/scripts/check-ci-detectors-to-test.py b/scripts/check-ci-detectors-to-test.py deleted file mode 100644 index b1d4ad59..00000000 --- a/scripts/check-ci-detectors-to-test.py +++ /dev/null @@ -1,26 +0,0 @@ -import argparse -import os -import yaml - -def is_special_directory(directory): - return directory == ".cargo" or directory == ".git" or directory == "target" - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Check if all detectors were tested by the CI") - parser.add_argument("gh_workflow_path", type=str, help="Path to the github workflow.") - parser.add_argument("detectors_path", type=str, help="Path to detectors folder") - args = parser.parse_args() - - with open(args.gh_workflow_path, "r") as f: - workflow = yaml.safe_load(f) - detectors_to_test = set(workflow["jobs"]["test"]["strategy"]["matrix"]["test"]) - - detectors = set(f.name for f in os.scandir(args.detectors_path) if f.is_dir() and not is_special_directory(f.name)) - # detectors.sort() - - sym_diff = detectors ^ detectors_to_test - if len(sym_diff)!=0 and sym_diff!=set(['soroban-version']): - print("Detectors to test in the workflow are not the same as the detectors in the detectors folder.") - print("Detectors to test: ", detectors_to_test) - print("Detectors in the folder: ", detectors) - exit(1) diff --git a/scripts/check-detectors-names-match-folder.py b/scripts/check-detectors-names-match-folder.py deleted file mode 100644 index 0a4be5cb..00000000 --- a/scripts/check-detectors-names-match-folder.py +++ /dev/null @@ -1,49 +0,0 @@ -import argparse -import os -from pathlib import Path - -def get_recursive_package_names(root_path): - results = [] - - # Walk through the directory structure - for dirpath, dirnames, filenames in os.walk(root_path): - if "Cargo.toml" in filenames: - file_path = os.path.join(dirpath, "Cargo.toml") - with open(file_path, "r") as f: - lines = f.readlines() - found_package_name = False - for line in lines: - if line.strip() == "[workspace]": - found_package_name = True - break - if "name =" in line: - package_name = line.split("=")[1].strip().replace('"', "") - results.append((file_path, package_name)) - found_package_name = True - break - if not found_package_name: - raise Exception(f"Failed to parse package name from {file_path}") - return results - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description="Check if any detectors names don't match their folder" - ) - parser.add_argument("detectors_path", type=str, help="Path to detectors folder") - args = parser.parse_args() - - results = get_recursive_package_names(args.detectors_path) - sorted_results = sorted(results, key=lambda x: x[1]) - - # Check if they match the name of the folder - failed_results = [] - for r in sorted_results: - folder_name = Path(r[0]).parent.name - if folder_name != r[1]: - failed_results.append(r) - - if len(failed_results) > 0: - print("Found detectors with different package names than their folder:") - for fr in failed_results: - print(f"\t{fr[0]} - {fr[1]}") - exit(1) diff --git a/scripts/check-detectors-repeated-names.py b/scripts/check-detectors-repeated-names.py deleted file mode 100644 index b8aa5282..00000000 --- a/scripts/check-detectors-repeated-names.py +++ /dev/null @@ -1,59 +0,0 @@ -import argparse -import os - - -def get_recursive_package_names(root_path): - results = [] - - # Walk through the directory structure - for dirpath, dirnames, filenames in os.walk(root_path): - if "Cargo.toml" in filenames: - file_path = os.path.join(dirpath, "Cargo.toml") - with open(file_path, "r") as f: - lines = f.readlines() - found_package_name = False - for line in lines: - if line.strip() == "[workspace]": - found_package_name = True - break - if "name =" in line: - package_name = line.split("=")[1].strip().replace('"', "") - results.append((file_path, package_name)) - found_package_name = True - break - if not found_package_name: - raise Exception(f"Failed to parse package name from {file_path}") - return results - - -def find_repeated(item_list): - seen = set() - dupes = [x for x in item_list if x in seen or seen.add(x)] - return list(set(dupes)) - - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description="Check if any detectors names are the same" - ) - parser.add_argument("detectors_path", type=str, help="Path to detectors folder") - args = parser.parse_args() - - results = get_recursive_package_names(args.detectors_path) - - # Find repeated and print results - sorted_results = sorted(results, key=lambda x: x[1]) - sorted_packages = [r[1] for r in sorted_results] - repeated_packages = find_repeated(sorted_packages) - - repeated_results = [] - for rp in repeated_packages: - matches = [x for x in sorted_results if x[1] == rp] - repeated_results.append(matches) - - if len(repeated_results) > 0: - for rr in repeated_results: - print(f"Found detectors with the same name `{rr[0][1]}`:") - for r in rr: - print(f"\t{r[0]}") - exit(1) diff --git a/scripts/check-detectors-underscore-names.py b/scripts/check-detectors-underscore-names.py deleted file mode 100644 index 9e42044d..00000000 --- a/scripts/check-detectors-underscore-names.py +++ /dev/null @@ -1,47 +0,0 @@ -import argparse -import os - - -def get_recursive_package_names(root_path): - results = [] - - # Walk through the directory structure - for dirpath, dirnames, filenames in os.walk(root_path): - if "Cargo.toml" in filenames: - file_path = os.path.join(dirpath, "Cargo.toml") - with open(file_path, "r") as f: - lines = f.readlines() - found_package_name = False - for line in lines: - if line.strip() == "[workspace]": - found_package_name = True - break - if "name =" in line: - package_name = line.split("=")[1].strip().replace('"', "") - results.append((file_path, package_name)) - found_package_name = True - break - if not found_package_name: - raise Exception(f"Failed to parse package name from {file_path}") - return results - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description="Check if any detectors names have underscores instead of hyphens" - ) - parser.add_argument("detectors_path", type=str, help="Path to detectors folder") - args = parser.parse_args() - - results = get_recursive_package_names(args.detectors_path) - sorted_results = sorted(results, key=lambda x: x[1]) - - # Check if they have underscores instead of hyphens - failed_results = [] - for r in sorted_results: - if "_" in r[1]: - failed_results.append(r) - if len(failed_results) > 0: - print("Found detectors with underscores instead of hyphens:") - for fr in failed_results: - print(f"\t{fr[0]} - {fr[1]}") - exit(1) diff --git a/scripts/list-cargo-directories.sh b/scripts/list-cargo-directories.sh deleted file mode 100755 index f2703d20..00000000 --- a/scripts/list-cargo-directories.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# Find all directories with a Cargo.toml file -directories=$(find . -name Cargo.toml -exec dirname {} \; | sort -u) - -# Print out the list of directories -for directory in $directories; do - echo "$directory" -done diff --git a/scripts/new-test-case.py b/scripts/new-test-case.py deleted file mode 100644 index c1155de3..00000000 --- a/scripts/new-test-case.py +++ /dev/null @@ -1,35 +0,0 @@ -# receive a name -# cd to test cases -# if the directory with that name exists -# go inside and create a new directory with -# name-n with n being how many directories there already are +1 -# if the directory does not exist -# create a new directory with that name -# and inside create a directory with that name and -1 - -import os -import sys - -def main(): - if len(sys.argv) != 2: - print("Usage: python3 new-test-case.py ") - return - - test_case_name = sys.argv[1] - test_case_path = os.path.join(os.getcwd(), "test-cases") - test_case_dir = os.path.join(test_case_path, test_case_name) - test_case_dir_n = os.path.join(test_case_dir, test_case_name + "-1") - - if os.path.exists(test_case_dir): - n = len(os.listdir(test_case_dir)) - test_case_dir_n = os.path.join(test_case_dir, test_case_name + "-" + str(n + 1)) - os.mkdir(test_case_dir_n) - else: - os.mkdir(test_case_dir) - os.mkdir(test_case_dir_n) - - os.mkdir(os.path.join(test_case_dir_n, "remediated-example")) - os.mkdir(os.path.join(test_case_dir_n, "vulnerable-example")) - -if __name__ == "__main__": - main() diff --git a/scripts/publish-to-crates-io.py b/scripts/publish-to-crates-io.py deleted file mode 100644 index dfbf187d..00000000 --- a/scripts/publish-to-crates-io.py +++ /dev/null @@ -1,60 +0,0 @@ -from pathlib import Path -import shutil -import subprocess -import tempfile -import time - -def get_package_name(file_path): - with open(file_path, "r") as f: - for line in f: - if line.startswith("name"): - return line.split("=")[1].strip().strip('"') - raise Exception("Could not find package name in Cargo.toml") - -def get_package_version(file_path): - with open(file_path, "r") as f: - for line in f: - if line.startswith("version"): - return line.split("=")[1].strip().strip('"') - raise Exception("Could not find package version in Cargo.toml") - -def is_package_published(package_name, package_version, package_path): - with tempfile.TemporaryDirectory() as tmpdirname: - subprocess.call(["cargo", "init"], cwd=tmpdirname) - if (package_path / "rust-toolchain").exists(): - shutil.copy(package_path / "rust-toolchain", Path(tmpdirname) / "rust-toolchain") - with open(Path(tmpdirname) / "Cargo.toml", "a") as f: - f.write(f'{package_name} = "={package_version}"') - print(f"Checking if {package_name} {package_version} is published...") - try: - subprocess.check_output(["cargo", "check"], cwd=tmpdirname) - return True - except subprocess.CalledProcessError: - return False - except: - raise - -def publish_package(package_path): - subprocess.check_output(["cargo", "publish"], cwd=package_path) - -if __name__ == "__main__": - ROOT_PATH = Path(__file__).parent.parent - CARGO_SCOUT_AUDIT_PATH = ROOT_PATH / "apps" / "cargo-scout-audit" - SCOUT_AUDIT_CLIPPY_UTILS = ROOT_PATH / "scout-audit-clippy-utils" - SCOUT_AUDIT_INTERNAL_PATH = ROOT_PATH / "scout-audit-internal" - - packages_paths = [SCOUT_AUDIT_CLIPPY_UTILS, SCOUT_AUDIT_INTERNAL_PATH, CARGO_SCOUT_AUDIT_PATH] - - for path in packages_paths: - package_name = get_package_name(path / "Cargo.toml") - package_version = get_package_version(path / "Cargo.toml") - print(f"Publishing {package_name} {package_version}...") - - if not is_package_published(package_name, package_version, path): - publish_package(path) - while not is_package_published(package_name, package_version, path): - print(f"{package_name} {package_version} is not published yet, waiting 10 seconds...") - time.sleep(10) - print(f"{package_name} {package_version} is published") - else: - print(f"{package_name} {package_version} is already published") diff --git a/scripts/run-cargo-clippy.sh b/scripts/run-cargo-clippy.sh deleted file mode 100755 index 0efacf2d..00000000 --- a/scripts/run-cargo-clippy.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Read the list of directories from stdin -directories=$(cat) - -# Create a list of directories to push into if any fail -failed_directories="" - -# Run cargo clippy on each directory -for directory in $directories; do - echo "Running cargo clippy on $directory" - (cd "$directory" && cargo clippy --all --all-features --quiet -- -D warnings) - if [ $? -ne 0 ]; then - failed_directories="$failed_directories\n$directory" - fi -done - -# If any directories failed, print them out and exit with an error -if [ -n "$failed_directories" ]; then - printf "\nThe following directories failed cargo clippy:$failed_directories\n" - exit 1 -fi diff --git a/scripts/run-cargo-fmt.sh b/scripts/run-cargo-fmt.sh deleted file mode 100755 index d97a9ce6..00000000 --- a/scripts/run-cargo-fmt.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# Parse command line arguments -check=0 -while [[ "$#" -gt 0 ]]; do - case $1 in - --check) check=1 ;; - *) echo "Unknown parameter passed: $1"; exit 1 ;; - esac - shift -done - -# Read the list of directories from stdin -directories=$(cat) - -# Create a list of directories to push into if any fail -failed_directories="" - -# Run cargo fmt on each directory -for directory in $directories; do - echo "Running cargo fmt on $directory" - if [[ $check -eq 1 ]]; then - (cd "$directory" && cargo +nightly fmt --check) - else - (cd "$directory" && cargo +nightly fmt) - fi - - if [ $? -ne 0 ]; then - failed_directories="$failed_directories\n$directory" - fi -done - -# If any directories failed, print them out and exit with an error -if [ -n "$failed_directories" ]; then - printf "\nThe following directories failed cargo fmt:$failed_directories\n" - exit 1 -fi diff --git a/scripts/run-cargo-test.sh b/scripts/run-cargo-test.sh deleted file mode 100755 index 42efcb5b..00000000 --- a/scripts/run-cargo-test.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# Read the list of directories from stdin -directories=$(cat) - -# Create a list of directories to push into if any fail -failed_directories="" - -# Run cargo fmt on each directory -for directory in $directories; do - echo "Running cargo test on $directory" - (cd "$directory" && cargo test --all --all-features --quiet) - if [ $? -ne 0 ]; then - failed_directories="$failed_directories\n$directory" - fi -done - -# If any directories failed, print them out and exit with an error -if [ -n "$failed_directories" ]; then - printf "\nThe following directories failed cargo test:$failed_directories\n" - exit 1 -fi From 10766bf40f939c76630dfcbe5e13b8f30ac6f061 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 13:42:06 -0300 Subject: [PATCH 36/93] Try to test on windows-latest --- .github/workflows/test-detectors.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index c7a905a4..ebad4f30 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -44,6 +44,7 @@ jobs: os: - ubuntu-latest - macos-latest + - windows-latest runs-on: ${{ matrix.os }} steps: - name: Checkout repository @@ -92,6 +93,7 @@ jobs: os: - ubuntu-latest - macos-latest + - windows-latest detector: ${{fromJson(needs.prepare-detector-matrix.outputs.matrix)}} runs-on: ${{ matrix.os }} steps: From 6643a547360c41649301f945a9c1025c5e43cd1d Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 14:03:02 -0300 Subject: [PATCH 37/93] Remove windows (not yet supported) --- .github/workflows/test-detectors.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index ebad4f30..c7a905a4 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -44,7 +44,6 @@ jobs: os: - ubuntu-latest - macos-latest - - windows-latest runs-on: ${{ matrix.os }} steps: - name: Checkout repository @@ -93,7 +92,6 @@ jobs: os: - ubuntu-latest - macos-latest - - windows-latest detector: ${{fromJson(needs.prepare-detector-matrix.outputs.matrix)}} runs-on: ${{ matrix.os }} steps: From a45ef20e8c801586d4687498892a4ecb4f8c3a3e Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 17:02:36 -0300 Subject: [PATCH 38/93] Try clean udeps ci --- .github/workflows/general-rust.yml | 25 ++++++++++++- scripts/run-clippy.py | 22 ++++++++++- scripts/run-fmt.py | 22 ++++++++++- scripts/run-udeps.py | 60 ++++++++++++++++++++++++------ 4 files changed, 112 insertions(+), 17 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index df09d26f..52df409b 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -39,7 +39,7 @@ jobs: run: rustup component add rustfmt --toolchain nightly - name: Check Format - run: python scripts/run-fmt.py + run: python scripts/run-fmt.py --dir test-cases detectors clippy: name: Lint with Clippy @@ -74,4 +74,25 @@ jobs: run: rustup component add clippy --toolchain nightly - name: Lint with Clippy - run: python scripts/run-clippy.py + run: python scripts/run-clippy.py --dir test-cases detectors + + udeps: + name: Check for unused dependencies + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.9" + + - name: Update Rust Toolchain + run: rustup update + + - name: Install cargo-udeps + run: cargo install cargo-udeps + + - name: Check for unused dependencies + run: python scripts/run-udeps.py --dir test-cases detectors diff --git a/scripts/run-clippy.py b/scripts/run-clippy.py index 02d8b909..6e10c3c5 100644 --- a/scripts/run-clippy.py +++ b/scripts/run-clippy.py @@ -1,3 +1,4 @@ +import argparse import os import subprocess import time @@ -11,6 +12,12 @@ def run_clippy(directories): errors = [] for directory in directories: + if not os.path.isdir(directory): + errors.append( + f"Error: The specified path '{directory}' is not a directory or does not exist." + ) + continue + print(f"\n{GREEN}Running clippy in {directory}:{ENDC}") for root, _, files in os.walk(directory): if "Cargo.toml" in files: @@ -54,8 +61,19 @@ def print_clippy_errors(errors): if __name__ == "__main__": - directories = ["test-cases", "detectors"] - errors = run_clippy(directories) + parser = argparse.ArgumentParser( + description="Run cargo-clippy for specified directories" + ) + parser.add_argument( + "--dir", + nargs="+", + required=True, + help="Specify the directories to run cargo-clippy on. Multiple directories can be specified.", + ) + + args = parser.parse_args() + + errors = run_clippy(args.dir) print_clippy_errors(errors) if errors: exit(1) diff --git a/scripts/run-fmt.py b/scripts/run-fmt.py index 043106b1..ad061a14 100644 --- a/scripts/run-fmt.py +++ b/scripts/run-fmt.py @@ -1,3 +1,4 @@ +import argparse import os import subprocess import time @@ -12,6 +13,12 @@ def run_fmt(directories): errors = [] for directory in directories: + if not os.path.isdir(directory): + errors.append( + f"Error: The specified path '{directory}' is not a directory or does not exist." + ) + continue + print(f"\n{GREEN}Checking format in {directory}:{ENDC}") for root, _, files in os.walk(directory): if "Cargo.toml" in files: @@ -47,8 +54,19 @@ def print_fmt_errors(errors): if __name__ == "__main__": - directories = ["test-cases", "detectors"] - errors = run_fmt(directories) + parser = argparse.ArgumentParser( + description="Run cargo-fmt for specified directories" + ) + parser.add_argument( + "--dir", + nargs="+", + required=True, + help="Specify the directories to run cargo-fmt on. Multiple directories can be specified.", + ) + + args = parser.parse_args() + + errors = run_fmt(args.dir) print_fmt_errors(errors) if errors: exit(1) diff --git a/scripts/run-udeps.py b/scripts/run-udeps.py index 2c4d7c16..39896f60 100644 --- a/scripts/run-udeps.py +++ b/scripts/run-udeps.py @@ -1,39 +1,77 @@ +import argparse import os import subprocess +import time + +RED = "\033[91m" +GREEN = "\033[92m" +BLUE = "\033[94m" +ENDC = "\033[0m" -RED = '\033[91m' -GREEN = '\033[92m' -ENDC = '\033[0m' def run_udeps(directories): errors = [] for directory in directories: + if not os.path.isdir(directory): + errors.append( + f"Error: The specified path '{directory}' is not a directory or does not exist." + ) + continue + print(f"\n{GREEN}Checking unused dependencies in {directory}:{ENDC}") for root, _, files in os.walk(directory): - if 'Cargo.toml' in files: - print(f"Checking unused dependencies in: {root}") - subprocess.run(['cargo', 'update'], cwd=root) - result = subprocess.run(['cargo', '+nightly', 'udeps', '--no-default-features', '--locked', '--backend=save-analysis'], cwd=root, capture_output=True, text=True) + if "Cargo.toml" in files: + start_time = time.time() + result = subprocess.run( + [ + "cargo", + "udeps", + "--all-targets", + ], + cwd=root, + capture_output=True, + text=True, + ) + end_time = time.time() + elapsed_time = end_time - start_time + print( + f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed udeps check in: {root}." + ) if result.returncode != 0: print(f"\n{RED}Unused dependencies found in: {root}{ENDC}\n") error_message = result.stderr.strip() - for line in error_message.split('\n'): + for line in error_message.split("\n"): print(f"| {line}") print("\n") errors.append(root) return errors + def print_udeps_errors(errors): if errors: - print(f"{RED}\nUnused dependencies detected in the following directories:{ENDC}") + print( + f"{RED}\nUnused dependencies detected in the following directories:{ENDC}" + ) for error_dir in errors: print(f"• {error_dir}") else: print(f"{GREEN}\nNo unused dependencies found across all directories.{ENDC}") + if __name__ == "__main__": - directories = ['test-cases', 'detectors'] - errors = run_udeps(directories) + parser = argparse.ArgumentParser( + description="Run cargo-udeps for specified directories" + ) + parser.add_argument( + "--dir", + nargs="+", + required=True, + help="Specify the directories to run cargo-udeps on. Multiple directories can be specified.", + ) + + args = parser.parse_args() + + errors = run_udeps(args.dir) print_udeps_errors(errors) if errors: exit(1) From 45aedec1851a713839e07f2022bff5c3835c0009 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 17:13:01 -0300 Subject: [PATCH 39/93] Default to specific nightly --- .github/workflows/general-rust.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 52df409b..3ac43482 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -91,6 +91,12 @@ jobs: - name: Update Rust Toolchain run: rustup update + - name: Install Rust nightly + run: rustup install nightly-2023-12-16 + + - name: Default to nightly + run: rustup default nightly-2023-12-16 + - name: Install cargo-udeps run: cargo install cargo-udeps From 0d9b5326058706eb337c3e63438c85c759cb33b3 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 17:26:03 -0300 Subject: [PATCH 40/93] Use scout-audit toolchain --- .github/workflows/general-rust.yml | 17 +++++++++++------ scripts/run-udeps.py | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 3ac43482..2e4fa3f9 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -65,10 +65,10 @@ jobs: run: rustup update - name: Install Rust nightly - run: rustup install nightly --profile minimal + run: rustup install nightly-2023-12-16 --profile minimal - name: Install dylint-link - run: cargo install dylint-link --force + run: cargo install dylint-link - name: Install clippy run: rustup component add clippy --toolchain nightly @@ -88,14 +88,19 @@ jobs: with: python-version: "3.9" + - name: Cache Rust Dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cargo + ~/.rustup + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Update Rust Toolchain run: rustup update - name: Install Rust nightly - run: rustup install nightly-2023-12-16 - - - name: Default to nightly - run: rustup default nightly-2023-12-16 + run: rustup install nightly-2023-12-16 --profile minimal - name: Install cargo-udeps run: cargo install cargo-udeps diff --git a/scripts/run-udeps.py b/scripts/run-udeps.py index 39896f60..6bc83f30 100644 --- a/scripts/run-udeps.py +++ b/scripts/run-udeps.py @@ -25,6 +25,7 @@ def run_udeps(directories): result = subprocess.run( [ "cargo", + "+nightly", "udeps", "--all-targets", ], From ddfab9fa0719f50cb94407bbead5d5ca0f9f8e82 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 17:29:50 -0300 Subject: [PATCH 41/93] Do not share cache with clippy --- .github/workflows/general-rust.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 2e4fa3f9..a53c26bf 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -59,13 +59,14 @@ jobs: path: | ~/.cargo ~/.rustup + **/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain run: rustup update - name: Install Rust nightly - run: rustup install nightly-2023-12-16 --profile minimal + run: rustup install nightly --profile minimal - name: Install dylint-link run: cargo install dylint-link @@ -94,13 +95,13 @@ jobs: path: | ~/.cargo ~/.rustup - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-udeps-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain run: rustup update - name: Install Rust nightly - run: rustup install nightly-2023-12-16 --profile minimal + run: rustup install nightly-2023-12-16 - name: Install cargo-udeps run: cargo install cargo-udeps From 637e29049178f2dca3e066a7c8f92e8f09ab2262 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 17:37:43 -0300 Subject: [PATCH 42/93] Try run udeps --- .github/workflows/general-rust.yml | 3 +++ scripts/run-udeps.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index a53c26bf..ef03f115 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -103,6 +103,9 @@ jobs: - name: Install Rust nightly run: rustup install nightly-2023-12-16 + - name: Default to nightly + run: rustup default nightly + - name: Install cargo-udeps run: cargo install cargo-udeps diff --git a/scripts/run-udeps.py b/scripts/run-udeps.py index 6bc83f30..39896f60 100644 --- a/scripts/run-udeps.py +++ b/scripts/run-udeps.py @@ -25,7 +25,6 @@ def run_udeps(directories): result = subprocess.run( [ "cargo", - "+nightly", "udeps", "--all-targets", ], From 868cca1bebdae6fcc6d755b1f92604d785f66b6b Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 17:46:57 -0300 Subject: [PATCH 43/93] Go back to when udeps worked --- .github/workflows/general-rust.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index ef03f115..90b0a5d0 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -89,14 +89,6 @@ jobs: with: python-version: "3.9" - - name: Cache Rust Dependencies - uses: actions/cache@v4 - with: - path: | - ~/.cargo - ~/.rustup - key: ${{ runner.os }}-cargo-udeps-${{ hashFiles('**/Cargo.lock') }} - - name: Update Rust Toolchain run: rustup update @@ -104,7 +96,7 @@ jobs: run: rustup install nightly-2023-12-16 - name: Default to nightly - run: rustup default nightly + run: rustup default nightly-2023-12-16 - name: Install cargo-udeps run: cargo install cargo-udeps From 56cdbfaaa898bf4086ffdb29f4b6ed923f211864 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 17:57:31 -0300 Subject: [PATCH 44/93] Cache udeps --- .github/workflows/general-rust.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 90b0a5d0..3ab09549 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -59,7 +59,6 @@ jobs: path: | ~/.cargo ~/.rustup - **/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain @@ -89,6 +88,14 @@ jobs: with: python-version: "3.9" + - name: Cache Rust Dependencies + uses: actions/cache@v4 + with: + path: | + ~/.cargo + ~/.rustup + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Update Rust Toolchain run: rustup update From 89275b33732496bba3dbfb1653f8ff18d2cdd2a7 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 18:22:52 -0300 Subject: [PATCH 45/93] Try fix soroban-version udeps error --- .github/workflows/general-rust.yml | 4 ++-- .github/workflows/test-detectors.yml | 8 ++++++++ .../soroban-version-1/remediated-example/Cargo.toml | 4 ++-- .../soroban-version-1/vulnerable-example/Cargo.toml | 1 - 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 3ab09549..29df57e0 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -59,7 +59,7 @@ jobs: path: | ~/.cargo ~/.rustup - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain run: rustup update @@ -94,7 +94,7 @@ jobs: path: | ~/.cargo ~/.rustup - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-udeps-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain run: rustup update diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index c7a905a4..a136f3cb 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -36,6 +36,14 @@ jobs: - name: Validate detectors run: python scripts/validate-detectors.py + - name: Create or Update Comment + uses: peter-evans/create-or-update-comment@v4.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + ✅ All detectors are valid. + build: name: Build needs: validate-detectors diff --git a/test-cases/soroban-version/soroban-version-1/remediated-example/Cargo.toml b/test-cases/soroban-version/soroban-version-1/remediated-example/Cargo.toml index f615db19..2bfb6108 100644 --- a/test-cases/soroban-version/soroban-version-1/remediated-example/Cargo.toml +++ b/test-cases/soroban-version/soroban-version-1/remediated-example/Cargo.toml @@ -7,10 +7,10 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -soroban-sdk = { version = "=20.3.2" } +soroban-sdk = { version = "20.0.0" } [dev_dependencies] -soroban-sdk = { version = "=20.3.2", features = ["testutils"] } +soroban-sdk = { version = "20.0.0", features = ["testutils"] } [features] testutils = ["soroban-sdk/testutils"] diff --git a/test-cases/soroban-version/soroban-version-1/vulnerable-example/Cargo.toml b/test-cases/soroban-version/soroban-version-1/vulnerable-example/Cargo.toml index 24ca1d8c..c5771258 100644 --- a/test-cases/soroban-version/soroban-version-1/vulnerable-example/Cargo.toml +++ b/test-cases/soroban-version/soroban-version-1/vulnerable-example/Cargo.toml @@ -3,7 +3,6 @@ name = "soroban-version-vulnerable-1" version = "0.1.0" edition = "2021" - [lib] crate-type = ["cdylib"] From 1d6b0ea47334bd160bb1d1c07822d9236d23df1e Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 18:35:18 -0300 Subject: [PATCH 46/93] Improve comment --- .github/workflows/test-detectors.yml | 36 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index a136f3cb..19277b19 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -21,6 +21,8 @@ jobs: validate-detectors: name: Validate runs-on: ubuntu-latest + outputs: + status: ${{ job.status }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -36,14 +38,6 @@ jobs: - name: Validate detectors run: python scripts/validate-detectors.py - - name: Create or Update Comment - uses: peter-evans/create-or-update-comment@v4.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.pull_request.number }} - body: | - ✅ All detectors are valid. - build: name: Build needs: validate-detectors @@ -53,6 +47,8 @@ jobs: - ubuntu-latest - macos-latest runs-on: ${{ matrix.os }} + outputs: + status: ${{ job.status }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -102,6 +98,8 @@ jobs: - macos-latest detector: ${{fromJson(needs.prepare-detector-matrix.outputs.matrix)}} runs-on: ${{ matrix.os }} + outputs: + status: ${{ job.status }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -121,3 +119,25 @@ jobs: - name: Run unit tests for a specific detector run: python scripts/run-tests.py --detector=${{ matrix.detector }} + + comment-on-pr: + name: Comment on PR + runs-on: ubuntu-latest + needs: [validate-detectors, build, test] + steps: + - name: Create or Update PR Comment + uses: peter-evans/create-or-update-comment@v4.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + 🎉 **Test Detectors Workflow Summary** 🎉 + + | Component | Status | + |-------------------------|--------| + | Detector Validation | ${{ (needs.validate-detectors.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | + | Build on Ubuntu | ${{ (contains(needs.build.result, 'ubuntu-latest') && needs.build.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | + | Build on macOS | ${{ (contains(needs.build.result, 'macos-latest') && needs.build.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | + | Tests Execution | ${{ (needs.test.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | + + The workflow has completed. Please check the statuses above for more details. Great job! 🚀 From a7a9a0eca5973ba019f13a5a29cb4d4052c1bab5 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 19:44:50 -0300 Subject: [PATCH 47/93] Try fix comment and cache individual tests --- .github/workflows/general-rust.yml | 27 +++++++++++++++++++++++++++ .github/workflows/test-detectors.yml | 17 +++++++++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 29df57e0..1ac24554 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -20,6 +20,8 @@ jobs: format: name: Check Rust Format runs-on: ubuntu-latest + outputs: + status: ${{ job.status }} steps: - name: Checkout Code uses: actions/checkout@v4 @@ -44,6 +46,8 @@ jobs: clippy: name: Lint with Clippy runs-on: ubuntu-latest + outputs: + status: ${{ job.status }} steps: - name: Checkout Code uses: actions/checkout@v4 @@ -79,6 +83,8 @@ jobs: udeps: name: Check for unused dependencies runs-on: ubuntu-latest + outputs: + status: ${{ job.status }} steps: - name: Checkout Code uses: actions/checkout@v4 @@ -110,3 +116,24 @@ jobs: - name: Check for unused dependencies run: python scripts/run-udeps.py --dir test-cases detectors + + comment-on-pr: + name: Comment on PR + runs-on: ubuntu-latest + needs: [format, clippy, udeps] + steps: + - name: Create or Update PR Comment + uses: peter-evans/create-or-update-comment@v4.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + 🎉 **General Rust Workflow Summary** 🎉 + + | Component | Status | + |---------------------------|--------| + | Check Rust Format | ${{ (needs.format.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | + | Lint with Clippy | ${{ (needs.clippy.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | + | Check for unused deps (udeps) | ${{ (needs.udeps.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | + + The workflow has completed. Please check the statuses above for more details. Great job! 🚀 diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 19277b19..50be5074 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -48,7 +48,8 @@ jobs: - macos-latest runs-on: ${{ matrix.os }} outputs: - status: ${{ job.status }} + ubuntu-status: ${{ (matrix.os == 'ubuntu-latest' && job.status) || 'not-applicable' }} + macos-status: ${{ (matrix.os == 'macos-latest' && job.status) || 'not-applicable' }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -114,9 +115,17 @@ jobs: with: path: | ~/.cargo - **/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Cache build artifacts for ${{ matrix.detector }} + uses: actions/cache@v4 + with: + path: | + target + key: ${{ runner.os }}-${{ matrix.detector }}-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.detector }}- + - name: Run unit tests for a specific detector run: python scripts/run-tests.py --detector=${{ matrix.detector }} @@ -136,8 +145,8 @@ jobs: | Component | Status | |-------------------------|--------| | Detector Validation | ${{ (needs.validate-detectors.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | - | Build on Ubuntu | ${{ (contains(needs.build.result, 'ubuntu-latest') && needs.build.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | - | Build on macOS | ${{ (contains(needs.build.result, 'macos-latest') && needs.build.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | + | Build on Ubuntu | ${{ (needs.build.outputs.ubuntu-status == 'success' && '✅ Successful') || '❌ Failed' }} | + | Build on macOS | ${{ (needs.build.outputs.macos-status == 'success' && '✅ Successful') || '❌ Failed' }} | | Tests Execution | ${{ (needs.test.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | The workflow has completed. Please check the statuses above for more details. Great job! 🚀 From 2093cf3499b5f17898e37d92a386ea6e3c3c3ef6 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 19:55:46 -0300 Subject: [PATCH 48/93] Try fix individual caching in tests --- .github/workflows/general-rust.yml | 2 +- .github/workflows/test-detectors.yml | 4 ++-- scripts/run-tests.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 1ac24554..bd193671 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -112,7 +112,7 @@ jobs: run: rustup default nightly-2023-12-16 - name: Install cargo-udeps - run: cargo install cargo-udeps + run: cargo install dylint-link cargo-udeps - name: Check for unused dependencies run: python scripts/run-udeps.py --dir test-cases detectors diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 50be5074..956028d1 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -86,7 +86,7 @@ jobs: - id: set-matrix working-directory: test-cases run: | - echo "matrix=$(find . -mindepth 1 -maxdepth 1 -type d | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + echo "matrix=$(find . -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT test: name: Test detector @@ -121,7 +121,7 @@ jobs: uses: actions/cache@v4 with: path: | - target + test-cases/${{ matrix.detector }}/target key: ${{ runner.os }}-${{ matrix.detector }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-${{ matrix.detector }}- diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 774db322..dab6f5ab 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -56,13 +56,13 @@ def print_tests_errors(errors): parser.add_argument( "--detector", type=str, - help='The detector to run tests for, e.g., "./unsafe-unwrap"', + help='The detector to run tests for, e.g., "unsafe-unwrap"', ) args = parser.parse_args() if args.detector: - errors = run_tests(args.detector.strip("./")) + errors = run_tests(args.detector) print_tests_errors(errors) if errors: exit(1) From de86b85fe6902baedb9b16828b71edd82cf12631 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 27 Mar 2024 20:01:51 -0300 Subject: [PATCH 49/93] Fix cache on tests --- .github/workflows/test-detectors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 956028d1..8bfd19c5 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -121,7 +121,7 @@ jobs: uses: actions/cache@v4 with: path: | - test-cases/${{ matrix.detector }}/target + test-cases/${{ matrix.detector }}/**/target key: ${{ runner.os }}-${{ matrix.detector }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-${{ matrix.detector }}- From 86f45ca7ace43b8c5434af89d054340cbf290ea5 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Thu, 28 Mar 2024 14:04:41 -0300 Subject: [PATCH 50/93] Try fix comment and remove individual cache, share general rust cache --- .github/workflows/general-rust.yml | 11 ++++--- .github/workflows/test-detectors.yml | 49 +++++++++++++++++++--------- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index bd193671..77b06354 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -63,19 +63,19 @@ jobs: path: | ~/.cargo ~/.rustup - key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain run: rustup update - name: Install Rust nightly - run: rustup install nightly --profile minimal + run: rustup install nightly-2023-12-16 --profile minimal - name: Install dylint-link run: cargo install dylint-link - name: Install clippy - run: rustup component add clippy --toolchain nightly + run: rustup component add clippy --toolchain nightly-2023-12-16 - name: Lint with Clippy run: python scripts/run-clippy.py --dir test-cases detectors @@ -100,13 +100,13 @@ jobs: path: | ~/.cargo ~/.rustup - key: ${{ runner.os }}-cargo-udeps-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain run: rustup update - name: Install Rust nightly - run: rustup install nightly-2023-12-16 + run: rustup install nightly-2023-12-16 --profile minimal - name: Default to nightly run: rustup default nightly-2023-12-16 @@ -120,6 +120,7 @@ jobs: comment-on-pr: name: Comment on PR runs-on: ubuntu-latest + if: ${{ always()}} needs: [format, clippy, udeps] steps: - name: Create or Update PR Comment diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 8bfd19c5..279f8a96 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -47,9 +47,6 @@ jobs: - ubuntu-latest - macos-latest runs-on: ${{ matrix.os }} - outputs: - ubuntu-status: ${{ (matrix.os == 'ubuntu-latest' && job.status) || 'not-applicable' }} - macos-status: ${{ (matrix.os == 'macos-latest' && job.status) || 'not-applicable' }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -59,7 +56,6 @@ jobs: with: path: | ~/.cargo - **/target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ runner.os }}-cargo- @@ -73,6 +69,15 @@ jobs: - name: Install dylint, dylint-link and cargo-scout-audit run: cargo +nightly install cargo-dylint dylint-link cargo-scout-audit + - name: Determine build status and write to file + run: echo "${{ job.status }}" > status-${{ matrix.os }}.txt + + - name: Upload build status artifact + uses: actions/upload-artifact@v4 + with: + name: build-status-${{ matrix.os }} + path: status-${{ matrix.os }}.txt + prepare-detector-matrix: name: Prepare Detector Matrix runs-on: ubuntu-latest @@ -117,27 +122,41 @@ jobs: ~/.cargo key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Cache build artifacts for ${{ matrix.detector }} - uses: actions/cache@v4 - with: - path: | - test-cases/${{ matrix.detector }}/**/target - key: ${{ runner.os }}-${{ matrix.detector }}-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.detector }}- - - name: Run unit tests for a specific detector run: python scripts/run-tests.py --detector=${{ matrix.detector }} comment-on-pr: name: Comment on PR runs-on: ubuntu-latest + if: ${{ always() }} needs: [validate-detectors, build, test] steps: + - name: Download build status artifacts + uses: actions/download-artifact@v4 + with: + pattern: build-status-* + + - name: Read Ubuntu build status + id: ubuntu_status + run: echo "status=$(cat status-ubuntu-latest.txt)" >> $GITHUB_OUTPUT + + - name: Read macOS build status + id: macos_status + run: echo "status=$(cat status-macos-latest.txt)" >> $GITHUB_OUTPUT + + - name: Find comment + id: find_comment + uses: peter-evans/find-comment@v3 + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: "github-actions[bot]" + body-includes: "🎉 **Test Detectors Workflow Summary** 🎉" + - name: Create or Update PR Comment uses: peter-evans/create-or-update-comment@v4.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} + comment-id: ${{ steps.find_comment.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | 🎉 **Test Detectors Workflow Summary** 🎉 @@ -145,8 +164,8 @@ jobs: | Component | Status | |-------------------------|--------| | Detector Validation | ${{ (needs.validate-detectors.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | - | Build on Ubuntu | ${{ (needs.build.outputs.ubuntu-status == 'success' && '✅ Successful') || '❌ Failed' }} | - | Build on macOS | ${{ (needs.build.outputs.macos-status == 'success' && '✅ Successful') || '❌ Failed' }} | + | Build on Ubuntu | ${{ (steps.ubuntu_status.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | + | Build on macOS | ${{ (steps.macos_status.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | | Tests Execution | ${{ (needs.test.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | The workflow has completed. Please check the statuses above for more details. Great job! 🚀 From 4dd80b5eb52e9c5d25b1f4ee52faa50440abae3b Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Thu, 28 Mar 2024 15:34:32 -0300 Subject: [PATCH 51/93] Find comment in general-rust, debug test detector output --- .github/workflows/general-rust.yml | 8 ++++++++ .github/workflows/test-detectors.yml | 10 ++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 77b06354..d1a86256 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -123,10 +123,18 @@ jobs: if: ${{ always()}} needs: [format, clippy, udeps] steps: + - name: Find comment + id: find_comment + uses: peter-evans/find-comment@v1 + with: + issue-number: ${{ github.event.pull_request.number }} + body-includes: "🎉 **General Rust Workflow Summary** 🎉" + - name: Create or Update PR Comment uses: peter-evans/create-or-update-comment@v4.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} + comment-id: ${{ steps.find_comment.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} body: | 🎉 **General Rust Workflow Summary** 🎉 diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 279f8a96..ec52b9cd 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -138,11 +138,17 @@ jobs: - name: Read Ubuntu build status id: ubuntu_status - run: echo "status=$(cat status-ubuntu-latest.txt)" >> $GITHUB_OUTPUT + run: | + ls -l + cat status-ubuntu-latest.txt + echo "status=$(cat status-ubuntu-latest.txt)" >> $GITHUB_OUTPUT - name: Read macOS build status id: macos_status - run: echo "status=$(cat status-macos-latest.txt)" >> $GITHUB_OUTPUT + run: | + ls -l + cat status-macos-latest.txt + echo "status=$(cat status-macos-latest.txt)" >> $GITHUB_OUTPUT - name: Find comment id: find_comment From 250a8e535c59862f2865b32bfb6410c04a1261c2 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Thu, 28 Mar 2024 16:02:34 -0300 Subject: [PATCH 52/93] Try fix comment --- .github/workflows/general-rust.yml | 4 ++-- .github/workflows/test-detectors.yml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index d1a86256..70a4d123 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -63,7 +63,7 @@ jobs: path: | ~/.cargo ~/.rustup - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain run: rustup update @@ -100,7 +100,7 @@ jobs: path: | ~/.cargo ~/.rustup - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-udeps-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain run: rustup update diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index ec52b9cd..cccc1769 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -56,9 +56,7 @@ jobs: with: path: | ~/.cargo - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain run: rustup update @@ -120,7 +118,7 @@ jobs: with: path: | ~/.cargo - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - name: Run unit tests for a specific detector run: python scripts/run-tests.py --detector=${{ matrix.detector }} @@ -138,15 +136,17 @@ jobs: - name: Read Ubuntu build status id: ubuntu_status + working-directory: status-ubuntu-latest run: | - ls -l + ls cat status-ubuntu-latest.txt echo "status=$(cat status-ubuntu-latest.txt)" >> $GITHUB_OUTPUT - name: Read macOS build status id: macos_status + working-directory: status-macos-latest run: | - ls -l + ls cat status-macos-latest.txt echo "status=$(cat status-macos-latest.txt)" >> $GITHUB_OUTPUT From 031f9b0b255dfdda51a30fcc30605bc2fe1afaaf Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Thu, 28 Mar 2024 16:39:13 -0300 Subject: [PATCH 53/93] Try fix artifacts download --- .github/workflows/general-rust.yml | 1 + .github/workflows/test-detectors.yml | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 70a4d123..99ebb600 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -135,6 +135,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} comment-id: ${{ steps.find_comment.outputs.comment-id }} + edit-mode: replace issue-number: ${{ github.event.pull_request.number }} body: | 🎉 **General Rust Workflow Summary** 🎉 diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index cccc1769..4ee3a5dd 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -131,12 +131,9 @@ jobs: steps: - name: Download build status artifacts uses: actions/download-artifact@v4 - with: - pattern: build-status-* - name: Read Ubuntu build status id: ubuntu_status - working-directory: status-ubuntu-latest run: | ls cat status-ubuntu-latest.txt @@ -144,7 +141,6 @@ jobs: - name: Read macOS build status id: macos_status - working-directory: status-macos-latest run: | ls cat status-macos-latest.txt @@ -163,6 +159,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} comment-id: ${{ steps.find_comment.outputs.comment-id }} + edit-mode: replace issue-number: ${{ github.event.pull_request.number }} body: | 🎉 **Test Detectors Workflow Summary** 🎉 From 88938329c0251f4b57e8cbfb2cb3ad3f32241c05 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Thu, 28 Mar 2024 17:15:31 -0300 Subject: [PATCH 54/93] Try fix again --- .github/workflows/test-detectors.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 4ee3a5dd..2bd2410f 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -134,6 +134,7 @@ jobs: - name: Read Ubuntu build status id: ubuntu_status + working-directory: build-status-ubuntu-latest run: | ls cat status-ubuntu-latest.txt @@ -141,6 +142,7 @@ jobs: - name: Read macOS build status id: macos_status + working-directory: build-status-macos-latest run: | ls cat status-macos-latest.txt From 41b56849b091ea5a4d30f7e51af7133135e166a3 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 3 Apr 2024 13:21:10 -0300 Subject: [PATCH 55/93] Update messages and format --- .github/workflows/general-rust.yml | 4 ++-- .github/workflows/test-detectors.yml | 22 ++++++---------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 99ebb600..1e3bd73f 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -125,7 +125,7 @@ jobs: steps: - name: Find comment id: find_comment - uses: peter-evans/find-comment@v1 + uses: peter-evans/find-comment@v3 with: issue-number: ${{ github.event.pull_request.number }} body-includes: "🎉 **General Rust Workflow Summary** 🎉" @@ -146,4 +146,4 @@ jobs: | Lint with Clippy | ${{ (needs.clippy.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | | Check for unused deps (udeps) | ${{ (needs.udeps.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | - The workflow has completed. Please check the statuses above for more details. Great job! 🚀 + The workflow has completed. Great job! 🚀 diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 2bd2410f..8639cfc8 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -54,8 +54,7 @@ jobs: - name: Cache cargo dependencies uses: actions/cache@v4 with: - path: | - ~/.cargo + path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - name: Update Rust Toolchain @@ -88,8 +87,7 @@ jobs: - id: set-matrix working-directory: test-cases - run: | - echo "matrix=$(find . -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + run: echo "matrix=$(find . -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT test: name: Test detector @@ -116,8 +114,7 @@ jobs: - name: Cache cargo dependencies uses: actions/cache@v4 with: - path: | - ~/.cargo + path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - name: Run unit tests for a specific detector @@ -135,25 +132,18 @@ jobs: - name: Read Ubuntu build status id: ubuntu_status working-directory: build-status-ubuntu-latest - run: | - ls - cat status-ubuntu-latest.txt - echo "status=$(cat status-ubuntu-latest.txt)" >> $GITHUB_OUTPUT + run: echo "status=$(cat status-ubuntu-latest.txt)" >> $GITHUB_OUTPUT - name: Read macOS build status id: macos_status working-directory: build-status-macos-latest - run: | - ls - cat status-macos-latest.txt - echo "status=$(cat status-macos-latest.txt)" >> $GITHUB_OUTPUT + run: echo "status=$(cat status-macos-latest.txt)" >> $GITHUB_OUTPUT - name: Find comment id: find_comment uses: peter-evans/find-comment@v3 with: issue-number: ${{ github.event.pull_request.number }} - comment-author: "github-actions[bot]" body-includes: "🎉 **Test Detectors Workflow Summary** 🎉" - name: Create or Update PR Comment @@ -173,4 +163,4 @@ jobs: | Build on macOS | ${{ (steps.macos_status.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | | Tests Execution | ${{ (needs.test.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | - The workflow has completed. Please check the statuses above for more details. Great job! 🚀 + The workflow has completed. Great job! 🚀 From 58eadf5965118f0014695f677c3eb242295dcff6 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 8 Apr 2024 17:55:53 -0300 Subject: [PATCH 56/93] Delete udeps and add integration tests to ci --- .github/workflows/general-rust.yml | 40 +--------- scripts/run-tests.py | 118 ++++++++++++++++++++++++----- 2 files changed, 98 insertions(+), 60 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 1e3bd73f..b2d21e80 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -80,48 +80,11 @@ jobs: - name: Lint with Clippy run: python scripts/run-clippy.py --dir test-cases detectors - udeps: - name: Check for unused dependencies - runs-on: ubuntu-latest - outputs: - status: ${{ job.status }} - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.9" - - - name: Cache Rust Dependencies - uses: actions/cache@v4 - with: - path: | - ~/.cargo - ~/.rustup - key: ${{ runner.os }}-cargo-udeps-${{ hashFiles('**/Cargo.lock') }} - - - name: Update Rust Toolchain - run: rustup update - - - name: Install Rust nightly - run: rustup install nightly-2023-12-16 --profile minimal - - - name: Default to nightly - run: rustup default nightly-2023-12-16 - - - name: Install cargo-udeps - run: cargo install dylint-link cargo-udeps - - - name: Check for unused dependencies - run: python scripts/run-udeps.py --dir test-cases detectors - comment-on-pr: name: Comment on PR runs-on: ubuntu-latest if: ${{ always()}} - needs: [format, clippy, udeps] + needs: [format, clippy] steps: - name: Find comment id: find_comment @@ -144,6 +107,5 @@ jobs: |---------------------------|--------| | Check Rust Format | ${{ (needs.format.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | | Lint with Clippy | ${{ (needs.clippy.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | - | Check for unused deps (udeps) | ${{ (needs.udeps.outputs.status == 'success' && '✅ Successful') || '❌ Failed' }} | The workflow has completed. Great job! 🚀 diff --git a/scripts/run-tests.py b/scripts/run-tests.py index dab6f5ab..15e939a3 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -1,4 +1,6 @@ +import json import os +import re import subprocess import argparse import time @@ -9,6 +11,97 @@ ENDC = "\033[0m" +def parse_json_from_string(console_output): + brace_count = 0 + json_start = None + json_end = None + + for i, char in enumerate(console_output): + if char == "{": + brace_count += 1 + if brace_count == 1: + json_start = i + elif char == "}": + brace_count -= 1 + if brace_count == 0 and json_start is not None: + json_end = i + 1 + break + + if json_start is not None and json_end is not None: + json_str = console_output[json_start:json_end] + try: + return json.loads(json_str) + except json.JSONDecodeError: + return "Extracted string is not valid JSON" + else: + return "No JSON found in the console output" + + +def run_unit_tests(root): + start_time = time.time() + result = subprocess.run( + ["cargo", "test", "--all-features", "--all"], + cwd=root, + capture_output=True, + text=True, + ) + end_time = time.time() + elapsed_time = end_time - start_time + print(f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed unit test in: {root}.") + if result.returncode != 0: + print(f"\n{RED}Test error found in: {root}{ENDC}\n") + error_message = result.stdout.strip() + for line in error_message.split("\n"): + print(f"| {line}") + print("\n") + return True + return False + + +def run_integration_tests(detector, root): + start_time = time.time() + short_message = "" + detector_metadata_result = subprocess.run( + ["cargo", "scout-audit", "--filter", detector, "--metadata"], + cwd=root, + capture_output=True, + text=True, + ) + + detector_metadata = parse_json_from_string(detector_metadata_result.stdout) + if not isinstance(detector_metadata, dict): + print("Failed to extract JSON:", detector_metadata) + return False + + detector_key = detector.replace("-", "_") + short_message = detector_metadata.get(detector_key, {}).get("short_message") + + result = subprocess.run( + ["cargo", "scout-audit", "--filter", detector], + cwd=root, + capture_output=True, + text=True, + ) + + elapsed_time = time.time() - start_time + print( + f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed integration test in: {root}." + ) + + should_lint = root.endswith("vulnerable-example") + if result.returncode != 0 or ( + should_lint and short_message and short_message not in result.stderr + ): + print(f"\n{RED}Test error found in: {root}{ENDC}\n") + error_message = result.stderr.strip() + for line in error_message.split("\n"): + print(f"| {line}") + print("\n") + return True + + return False + + def run_tests(detector): errors = [] directory = os.path.join("test-cases", detector) @@ -16,29 +109,12 @@ def run_tests(detector): if os.path.exists(directory): for root, _, files in os.walk(directory): if "Cargo.toml" in files: - start_time = time.time() - result = subprocess.run( - ["cargo", "test", "--all-features", "--all"], - cwd=root, - capture_output=True, - text=True, - ) - end_time = time.time() - elapsed_time = end_time - start_time - print( - f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed test in: {root}." - ) - if result.returncode != 0: - print(f"\n{RED}Test error found in: {root}{ENDC}\n") - error_message = result.stdout.strip() - for line in error_message.split("\n"): - print(f"| {line}") - print("\n") + if run_unit_tests(root): + errors.append(root) + if run_integration_tests(detector, root): errors.append(root) else: - print( - f"{RED}The specified detector directory does not exist: {directory}{ENDC}" - ) + print(f"{RED}The specified directory does not exist.{ENDC}") return errors From 5d90d55694b2cef872d81f2e0dc06bad4c0a95af Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Mon, 8 Apr 2024 18:04:07 -0300 Subject: [PATCH 57/93] Try fix test passing on invalid json output --- .github/workflows/test-detectors.yml | 2 +- scripts/run-tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 8639cfc8..e4e9a14f 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -117,7 +117,7 @@ jobs: path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - - name: Run unit tests for a specific detector + - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} comment-on-pr: diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 15e939a3..9dbf356b 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -71,7 +71,7 @@ def run_integration_tests(detector, root): detector_metadata = parse_json_from_string(detector_metadata_result.stdout) if not isinstance(detector_metadata, dict): print("Failed to extract JSON:", detector_metadata) - return False + return True detector_key = detector.replace("-", "_") short_message = detector_metadata.get(detector_key, {}).get("short_message") From 4b779819bbe60741dd9b7611fc3ab723af964a17 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 12:28:48 -0300 Subject: [PATCH 58/93] Delete release worfklow, add utils file --- .github/workflows/release.yml | 60 -------------- scripts/run-clippy.py | 33 ++------ scripts/run-fmt.py | 35 ++------ scripts/run-tests.py | 151 +++++++++++----------------------- scripts/run-udeps.py | 41 ++------- scripts/utils.py | 98 ++++++++++++++++++++++ 6 files changed, 171 insertions(+), 247 deletions(-) delete mode 100644 .github/workflows/release.yml create mode 100644 scripts/utils.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e21aa8f4..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Release - -on: - push: - tags: - - "v*.*.*" - -env: - CARGO_TERM_COLOR: always - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Login to crates.io - run: echo ${{ secrets.CRATES_TOKEN }} | cargo login - - - name: Publish to crates.io - run: python scripts/publish-to-crates-io.py - - - name: Create release notes - run: sed -n '/^## ${{ github.ref_name }}/,/^## v/{/^## ${{ github.ref_name }}/p; /^## v/!p;}' CHANGELOG.md | awk 'NF {print $0}' | tee body.md - - - name: Create release - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ github.ref }} - name: ${{ github.ref_name }} - body_path: body.md - draft: false - prerelease: ${{ contains(github.ref, 'pre') || contains(github.ref, 'rc') }} - token: ${{ secrets.GITHUB_TOKEN }} - - upload-binaries: - strategy: - matrix: - include: - - { o: macos-latest, t: x86_64-apple-darwin } - - { o: ubuntu-latest, t: x86_64-unknown-linux-gnu } - - { o: windows-latest, t: x86_64-pc-windows-msvc } - - name: Upload binaries - runs-on: ${{ matrix.o }} - needs: release - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Build and publish - uses: taiki-e/upload-rust-binary-action@v1 - with: - manifest_path: apps/cargo-scout-audit/Cargo.toml - bin: cargo-scout-audit - archive: cargo-scout-audit-${{ github.ref_name }}-${{ matrix.t }}-${{ matrix.o }} - tar: unix - zip: windows - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/run-clippy.py b/scripts/run-clippy.py index 6e10c3c5..4c36fb85 100644 --- a/scripts/run-clippy.py +++ b/scripts/run-clippy.py @@ -1,8 +1,9 @@ import argparse import os -import subprocess import time +from utils import print_errors, print_results, run_subprocess + RED = "\033[91m" GREEN = "\033[92m" BLUE = "\033[94m" @@ -22,7 +23,7 @@ def run_clippy(directories): for root, _, files in os.walk(directory): if "Cargo.toml" in files: start_time = time.time() - result = subprocess.run( + returncode, _, stderr = run_subprocess( [ "cargo", "clippy", @@ -33,31 +34,14 @@ def run_clippy(directories): "warnings", ], cwd=root, - capture_output=True, - text=True, ) - end_time = time.time() - elapsed_time = end_time - start_time - print( - f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed clippy check in: {root}." + print_results( + returncode, stderr, "clippy", root, time.time() - start_time ) - if result.returncode != 0: - print(f"\n{RED}Clippy issues found in: {root}{ENDC}\n") - error_message = result.stderr.strip() - for line in error_message.split("\n"): - print(f"| {line}") - print("\n") + if returncode != 0: errors.append(root) - return errors - -def print_clippy_errors(errors): - if errors: - print(f"{RED}\nClippy errors detected in the following directories:{ENDC}") - for error_dir in errors: - print(f"• {error_dir}") - else: - print(f"{GREEN}\nNo clippy issues found across all directories.{ENDC}") + return errors if __name__ == "__main__": @@ -70,10 +54,9 @@ def print_clippy_errors(errors): required=True, help="Specify the directories to run cargo-clippy on. Multiple directories can be specified.", ) - args = parser.parse_args() errors = run_clippy(args.dir) - print_clippy_errors(errors) + print_errors(errors) if errors: exit(1) diff --git a/scripts/run-fmt.py b/scripts/run-fmt.py index ad061a14..3e330ff0 100644 --- a/scripts/run-fmt.py +++ b/scripts/run-fmt.py @@ -1,8 +1,8 @@ import argparse import os -import subprocess import time -from datetime import datetime + +from utils import print_errors, print_results, run_subprocess RED = "\033[91m" GREEN = "\033[92m" @@ -23,36 +23,18 @@ def run_fmt(directories): for root, _, files in os.walk(directory): if "Cargo.toml" in files: start_time = time.time() - result = subprocess.run( - ["cargo", "+nightly", "fmt", "--", "--check", "-v"], + returncode, _, stderr = run_subprocess( + ["cargo", "fmt", "--all"], cwd=root, - capture_output=True, - text=True, ) - end_time = time.time() - elapsed_time = end_time - start_time - print( - f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed format check in: {root}." + print_results( + returncode, stderr, "format", root, time.time() - start_time ) - if result.returncode != 0: - print(f"\n{RED}Formatting issues found in: {root}{ENDC}\n") - error_message = result.stdout.strip() - for line in error_message.split("\n"): - print(f"| {line}") - print("\n") + if returncode != 0: errors.append(root) return errors -def print_fmt_errors(errors): - if errors: - print(f"{RED}\nFormatting errors detected in the following directories:{ENDC}") - for error_dir in errors: - print(f"• {error_dir}") - else: - print(f"{GREEN}\nNo formatting issues found across all directories.{ENDC}") - - if __name__ == "__main__": parser = argparse.ArgumentParser( description="Run cargo-fmt for specified directories" @@ -63,10 +45,9 @@ def print_fmt_errors(errors): required=True, help="Specify the directories to run cargo-fmt on. Multiple directories can be specified.", ) - args = parser.parse_args() errors = run_fmt(args.dir) - print_fmt_errors(errors) + print_errors(errors) if errors: exit(1) diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 9dbf356b..aae41f2a 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -1,74 +1,55 @@ import json import os -import re -import subprocess import argparse import time +from utils import parse_json_from_string, print_errors, print_results, run_subprocess + RED = "\033[91m" GREEN = "\033[92m" BLUE = "\033[94m" ENDC = "\033[0m" -def parse_json_from_string(console_output): - brace_count = 0 - json_start = None - json_end = None - - for i, char in enumerate(console_output): - if char == "{": - brace_count += 1 - if brace_count == 1: - json_start = i - elif char == "}": - brace_count -= 1 - if brace_count == 0 and json_start is not None: - json_end = i + 1 - break - - if json_start is not None and json_end is not None: - json_str = console_output[json_start:json_end] - try: - return json.loads(json_str) - except json.JSONDecodeError: - return "Extracted string is not valid JSON" - else: - return "No JSON found in the console output" +def run_tests(detector): + errors = [] + directory = os.path.join("test-cases", detector) + print(f"\n{GREEN}Performing tests in {directory}:{ENDC}") + if not os.path.exists(directory): + print(f"{RED}The specified directory does not exist.{ENDC}") + return errors + + for root, _, files in os.walk(directory): + if "Cargo.toml" in files: + if run_unit_tests(root): + errors.append(root) + if run_integration_tests(detector, root): + errors.append(root) + return errors def run_unit_tests(root): start_time = time.time() - result = subprocess.run( - ["cargo", "test", "--all-features", "--all"], - cwd=root, - capture_output=True, - text=True, + returncode, stdout, _ = run_subprocess( + ["cargo", "test", "--all-features", "--all"], root ) - end_time = time.time() - elapsed_time = end_time - start_time - print(f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed unit test in: {root}.") - if result.returncode != 0: - print(f"\n{RED}Test error found in: {root}{ENDC}\n") - error_message = result.stdout.strip() - for line in error_message.split("\n"): - print(f"| {line}") - print("\n") - return True - return False + print_results( + returncode, + stdout, + "unit-test", + root, + time.time() - start_time, + ) + return returncode != 0 def run_integration_tests(detector, root): start_time = time.time() - short_message = "" - detector_metadata_result = subprocess.run( - ["cargo", "scout-audit", "--filter", detector, "--metadata"], - cwd=root, - capture_output=True, - text=True, + returncode, stdout, _ = run_subprocess( + ["cargo", "scout-audit", "--filter", detector, "--metadata"], root ) + detector_metadata = parse_json_from_string(stdout) - detector_metadata = parse_json_from_string(detector_metadata_result.stdout) if not isinstance(detector_metadata, dict): print("Failed to extract JSON:", detector_metadata) return True @@ -76,55 +57,22 @@ def run_integration_tests(detector, root): detector_key = detector.replace("-", "_") short_message = detector_metadata.get(detector_key, {}).get("short_message") - result = subprocess.run( - ["cargo", "scout-audit", "--filter", detector], - cwd=root, - capture_output=True, - text=True, - ) - - elapsed_time = time.time() - start_time - print( - f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed integration test in: {root}." + returncode, _, stderr = run_subprocess( + ["cargo", "scout-audit", "--filter", detector], root ) should_lint = root.endswith("vulnerable-example") - if result.returncode != 0 or ( - should_lint and short_message and short_message not in result.stderr - ): - print(f"\n{RED}Test error found in: {root}{ENDC}\n") - error_message = result.stderr.strip() - for line in error_message.split("\n"): - print(f"| {line}") - print("\n") - return True - - return False - - -def run_tests(detector): - errors = [] - directory = os.path.join("test-cases", detector) - print(f"\n{GREEN}Performing tests in {directory}:{ENDC}") - if os.path.exists(directory): - for root, _, files in os.walk(directory): - if "Cargo.toml" in files: - if run_unit_tests(root): - errors.append(root) - if run_integration_tests(detector, root): - errors.append(root) - else: - print(f"{RED}The specified directory does not exist.{ENDC}") - return errors - - -def print_tests_errors(errors): - if errors: - print(f"{RED}\nErrors detected in the following directories:{ENDC}") - for error_dir in errors: - print(f"• {error_dir}") - else: - print(f"{GREEN}\nNo errors found in the specified directory.{ENDC}") + if should_lint and short_message and short_message not in stderr: + returncode = 1 + + print_results( + returncode, + stderr, + "integration-test", + root, + time.time() - start_time, + ) + return returncode != 0 if __name__ == "__main__": @@ -132,15 +80,12 @@ def print_tests_errors(errors): parser.add_argument( "--detector", type=str, + required=True, help='The detector to run tests for, e.g., "unsafe-unwrap"', ) - args = parser.parse_args() - if args.detector: - errors = run_tests(args.detector) - print_tests_errors(errors) - if errors: - exit(1) - else: - print(f"{RED}No detector specified. Please provide a detector argument.{ENDC}") + errors = run_tests(args.detector) + print_errors(errors) + if errors: + exit(1) diff --git a/scripts/run-udeps.py b/scripts/run-udeps.py index 39896f60..774d8df1 100644 --- a/scripts/run-udeps.py +++ b/scripts/run-udeps.py @@ -3,6 +3,8 @@ import subprocess import time +from utils import print_errors, print_results + RED = "\033[91m" GREEN = "\033[92m" BLUE = "\033[94m" @@ -22,40 +24,16 @@ def run_udeps(directories): for root, _, files in os.walk(directory): if "Cargo.toml" in files: start_time = time.time() - result = subprocess.run( - [ - "cargo", - "udeps", - "--all-targets", - ], - cwd=root, - capture_output=True, - text=True, + returncode, _, stderr = subprocess.run( + ["cargo", "udeps"], cwd=root, capture_output=True, text=True ) - end_time = time.time() - elapsed_time = end_time - start_time - print( - f"{BLUE}[> {elapsed_time:.2f} sec]{ENDC} - Completed udeps check in: {root}." + print_results( + returncode, stderr, "udeps", root, time.time() - start_time ) - if result.returncode != 0: - print(f"\n{RED}Unused dependencies found in: {root}{ENDC}\n") - error_message = result.stderr.strip() - for line in error_message.split("\n"): - print(f"| {line}") - print("\n") + if returncode != 0: errors.append(root) - return errors - -def print_udeps_errors(errors): - if errors: - print( - f"{RED}\nUnused dependencies detected in the following directories:{ENDC}" - ) - for error_dir in errors: - print(f"• {error_dir}") - else: - print(f"{GREEN}\nNo unused dependencies found across all directories.{ENDC}") + return errors if __name__ == "__main__": @@ -68,10 +46,9 @@ def print_udeps_errors(errors): required=True, help="Specify the directories to run cargo-udeps on. Multiple directories can be specified.", ) - args = parser.parse_args() errors = run_udeps(args.dir) - print_udeps_errors(errors) + print_errors(errors) if errors: exit(1) diff --git a/scripts/utils.py b/scripts/utils.py new file mode 100644 index 00000000..3ac311b5 --- /dev/null +++ b/scripts/utils.py @@ -0,0 +1,98 @@ +import json +import subprocess +from typing import Tuple, Optional + +RED = "\033[91m" +GREEN = "\033[92m" +BLUE = "\033[94m" +ENDC = "\033[0m" + + +def parse_json_from_string(console_output): + json_start, json_end = None, None + brace_count = 0 + + for i, char in enumerate(console_output): + if char == "{": + brace_count += 1 + if brace_count == 1: + json_start = i + elif char == "}": + brace_count -= 1 + if brace_count == 0 and json_start is not None: + json_end = i + 1 + break + + if json_start is not None and json_end is not None: + json_str = console_output[json_start:json_end] + try: + return json.loads(json_str) + except json.JSONDecodeError: + return "Extracted string is not valid JSON" + else: + return "No JSON found in the console output" + + +def run_subprocess( + command: list, cwd: str, capture: bool = True, handle_stderr: bool = True +) -> Tuple[int, Optional[str], Optional[str]]: + result = subprocess.run(command, cwd=cwd, capture_output=capture, text=True) + stdout = result.stdout.strip() if capture and result.stdout else None + stderr = result.stderr.strip() if handle_stderr and result.stderr else None + return (result.returncode, stdout, stderr) + + +def print_errors(errors): + if errors: + print(f"{RED}\nErrors detected in the following directories:{ENDC}") + for error_dir in errors: + print(f"• {error_dir}") + else: + print(f"{GREEN}\nNo errors found in the specified directory.{ENDC}") + + +def print_results( + returncode, + error_message, + check_type, + root, + elapsed_time, + issue_type="issues", + action_type="check", +): + message_color = RED if returncode != 0 else BLUE + print( + f"{message_color}[> {elapsed_time:.2f} sec]{ENDC} - Completed {check_type} {action_type} in: {root}." + ) + if returncode != 0: + print(f"\n{RED}{check_type.capitalize()} {issue_type} found in: {root}{ENDC}\n") + for line in error_message.strip().split("\n"): + print(f"| {line}") + print("\n") + + +def print_results(returncode, error_message, check_type, root, elapsed_time): + allowed_check_types = ["clippy", "fmt", "udeps", "unit-test", "integration-test"] + if check_type not in allowed_check_types: + raise ValueError( + f"Invalid check_type '{check_type}'. Allowed values are: {', '.join(allowed_check_types)}" + ) + + if check_type in ["clippy", "fmt", "udeps"]: + issue_type = "issues" + action_type = "check" + elif check_type in ["unit-test", "integration-test"]: + issue_type = "errors" + action_type = "run" + else: + raise ValueError(f"Invalid check_type '{check_type}'.") + + message_color = RED if returncode != 0 else BLUE + print( + f"{message_color}[> {elapsed_time:.2f} sec]{ENDC} - Completed {check_type} {action_type} in: {root}." + ) + if returncode != 0: + print(f"\n{RED}{check_type.capitalize()} {issue_type} found in: {root}{ENDC}\n") + for line in error_message.strip().split("\n"): + print(f"| {line}") + print("\n") From 70b460dbdcb3f8521611a936dc4453aef81fe097 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 12:30:23 -0300 Subject: [PATCH 59/93] Fix format issue --- scripts/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/utils.py b/scripts/utils.py index 3ac311b5..0e1acfd0 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -72,13 +72,13 @@ def print_results( def print_results(returncode, error_message, check_type, root, elapsed_time): - allowed_check_types = ["clippy", "fmt", "udeps", "unit-test", "integration-test"] + allowed_check_types = ["clippy", "format", "udeps", "unit-test", "integration-test"] if check_type not in allowed_check_types: raise ValueError( f"Invalid check_type '{check_type}'. Allowed values are: {', '.join(allowed_check_types)}" ) - if check_type in ["clippy", "fmt", "udeps"]: + if check_type in ["clippy", "format", "udeps"]: issue_type = "issues" action_type = "check" elif check_type in ["unit-test", "integration-test"]: From 18217d6a5817552c6bd855016a9812cc75f2b391 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 13:50:08 -0300 Subject: [PATCH 60/93] Clean scripts --- scripts/run-clippy.py | 2 -- scripts/run-fmt.py | 2 -- scripts/run-tests.py | 9 +++++++-- scripts/run-udeps.py | 2 -- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/scripts/run-clippy.py b/scripts/run-clippy.py index 4c36fb85..ddbc08cb 100644 --- a/scripts/run-clippy.py +++ b/scripts/run-clippy.py @@ -4,9 +4,7 @@ from utils import print_errors, print_results, run_subprocess -RED = "\033[91m" GREEN = "\033[92m" -BLUE = "\033[94m" ENDC = "\033[0m" diff --git a/scripts/run-fmt.py b/scripts/run-fmt.py index 3e330ff0..83148142 100644 --- a/scripts/run-fmt.py +++ b/scripts/run-fmt.py @@ -4,9 +4,7 @@ from utils import print_errors, print_results, run_subprocess -RED = "\033[91m" GREEN = "\033[92m" -BLUE = "\033[94m" ENDC = "\033[0m" diff --git a/scripts/run-tests.py b/scripts/run-tests.py index aae41f2a..9296a4cf 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -1,4 +1,3 @@ -import json import os import argparse import time @@ -7,7 +6,6 @@ RED = "\033[91m" GREEN = "\033[92m" -BLUE = "\033[94m" ENDC = "\033[0m" @@ -48,6 +46,13 @@ def run_integration_tests(detector, root): returncode, stdout, _ = run_subprocess( ["cargo", "scout-audit", "--filter", detector, "--metadata"], root ) + + if stdout is None: + print( + f"{RED}Failed to run integration tests in {root} - Metadata returned empty.{ENDC}" + ) + return True + detector_metadata = parse_json_from_string(stdout) if not isinstance(detector_metadata, dict): diff --git a/scripts/run-udeps.py b/scripts/run-udeps.py index 774d8df1..1d22a2e6 100644 --- a/scripts/run-udeps.py +++ b/scripts/run-udeps.py @@ -5,9 +5,7 @@ from utils import print_errors, print_results -RED = "\033[91m" GREEN = "\033[92m" -BLUE = "\033[94m" ENDC = "\033[0m" From adb36005a8316080bd228f9ceff4311a62cf0a89 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 14:45:09 -0300 Subject: [PATCH 61/93] Debug metadata on scout-audit --- scripts/utils.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/utils.py b/scripts/utils.py index 0e1acfd0..061271cc 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -33,12 +33,14 @@ def parse_json_from_string(console_output): return "No JSON found in the console output" -def run_subprocess( - command: list, cwd: str, capture: bool = True, handle_stderr: bool = True -) -> Tuple[int, Optional[str], Optional[str]]: - result = subprocess.run(command, cwd=cwd, capture_output=capture, text=True) - stdout = result.stdout.strip() if capture and result.stdout else None - stderr = result.stderr.strip() if handle_stderr and result.stderr else None +def run_subprocess(command: list, cwd: str): + result = subprocess.run(command, cwd=cwd, capture_output=True, text=True) + print(f"Running command: {command} in {cwd}") + print(f"Return code: {result.returncode}") + print(f"stdout: {result.stdout}") + print(f"stderr: {result.stderr}") + stdout = result.stdout.strip() if result.stdout else None + stderr = result.stderr.strip() if result.stderr else None return (result.returncode, stdout, stderr) From c55d647bbddfaf85f8d75d2e922e8d84dbbc4eac Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 15:20:42 -0300 Subject: [PATCH 62/93] Run tests on nightly 2023-12-16 --- .github/workflows/test-detectors.yml | 8 +++++--- scripts/validate-detectors.py | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index e4e9a14f..0ac5d68b 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -61,10 +61,10 @@ jobs: run: rustup update - name: Install Rust nightly - run: rustup install nightly --profile minimal + run: rustup install nightly-2023-12-16 --profile minimal - name: Install dylint, dylint-link and cargo-scout-audit - run: cargo +nightly install cargo-dylint dylint-link cargo-scout-audit + run: cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit - name: Determine build status and write to file run: echo "${{ job.status }}" > status-${{ matrix.os }}.txt @@ -87,7 +87,9 @@ jobs: - id: set-matrix working-directory: test-cases - run: echo "matrix=$(find . -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + run: | + matrix=$(find . -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]') + echo "matrix=$matrix" >> $GITHUB_OUTPUT test: name: Test detector diff --git a/scripts/validate-detectors.py b/scripts/validate-detectors.py index df858353..16f7de34 100644 --- a/scripts/validate-detectors.py +++ b/scripts/validate-detectors.py @@ -95,6 +95,7 @@ def validate_detectors(base_path): if detector == "README.md" or not os.path.isdir(detector_path): continue + print(f"Validating {detector}...") all_errors.extend(check_for_extra_files(detector_path)) examples = [ e From c95eb0ea6643030bd863de7ac5ff6e350b4abbeb Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 15:28:06 -0300 Subject: [PATCH 63/93] Default to nightly --- .github/workflows/test-detectors.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 0ac5d68b..c487668b 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -119,6 +119,9 @@ jobs: path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} + - name: Default to nightly toolchain + run: rustup default nightly-2023-12-16 + - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} From bd44c1a48b14de91fa6c0ce725529a0581305892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Losiggio?= Date: Tue, 9 Apr 2024 16:48:31 -0300 Subject: [PATCH 64/93] run only the tests on nightly-2023-12-16 --- .github/workflows/test-detectors.yml | 3 --- scripts/run-tests.py | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index c487668b..0ac5d68b 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -119,9 +119,6 @@ jobs: path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - - name: Default to nightly toolchain - run: rustup default nightly-2023-12-16 - - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 9296a4cf..b7237160 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -44,7 +44,7 @@ def run_unit_tests(root): def run_integration_tests(detector, root): start_time = time.time() returncode, stdout, _ = run_subprocess( - ["cargo", "scout-audit", "--filter", detector, "--metadata"], root + ["cargo", "+nightly-2023-12-16", "scout-audit", "--filter", detector, "--metadata"], root ) if stdout is None: @@ -63,7 +63,7 @@ def run_integration_tests(detector, root): short_message = detector_metadata.get(detector_key, {}).get("short_message") returncode, _, stderr = run_subprocess( - ["cargo", "scout-audit", "--filter", detector], root + ["cargo", "+nightly-2023-12-16", "scout-audit", "--filter", detector], root ) should_lint = root.endswith("vulnerable-example") From c9a26cfa4b77ad31d55d50ecbbfca9ca61591a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Losiggio?= Date: Tue, 9 Apr 2024 17:14:40 -0300 Subject: [PATCH 65/93] add nightly toolchain --- .github/workflows/test-detectors.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 0ac5d68b..6719e3a1 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -113,6 +113,9 @@ jobs: with: python-version: "3.9" + - name: Install Rust nightly + run: rustup install nightly-2023-12-16 --profile minimal + - name: Cache cargo dependencies uses: actions/cache@v4 with: From 198e7024572d0e6983844ecde4d571d5035f96fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Losiggio?= Date: Tue, 9 Apr 2024 17:24:57 -0300 Subject: [PATCH 66/93] test --- scripts/run-tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/run-tests.py b/scripts/run-tests.py index b7237160..9296a4cf 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -44,7 +44,7 @@ def run_unit_tests(root): def run_integration_tests(detector, root): start_time = time.time() returncode, stdout, _ = run_subprocess( - ["cargo", "+nightly-2023-12-16", "scout-audit", "--filter", detector, "--metadata"], root + ["cargo", "scout-audit", "--filter", detector, "--metadata"], root ) if stdout is None: @@ -63,7 +63,7 @@ def run_integration_tests(detector, root): short_message = detector_metadata.get(detector_key, {}).get("short_message") returncode, _, stderr = run_subprocess( - ["cargo", "+nightly-2023-12-16", "scout-audit", "--filter", detector], root + ["cargo", "scout-audit", "--filter", detector], root ) should_lint = root.endswith("vulnerable-example") From dfe171cb25e8c5c8e1256d5bf5030f2f561606b0 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 17:40:20 -0300 Subject: [PATCH 67/93] Test cache --- .github/workflows/test-detectors.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 6719e3a1..0ac5d68b 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -113,9 +113,6 @@ jobs: with: python-version: "3.9" - - name: Install Rust nightly - run: rustup install nightly-2023-12-16 --profile minimal - - name: Cache cargo dependencies uses: actions/cache@v4 with: From 25b3ed3d0d4657df0421ca14dbae387500c8a3ff Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 18:12:16 -0300 Subject: [PATCH 68/93] Test --- .github/workflows/test-detectors.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 0ac5d68b..c4cbcf35 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -119,6 +119,12 @@ jobs: path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} + - name: Install Rust nightly + run: rustup install nightly-2023-12-16 --profile minimal + + - name: Install dylint, dylint-link and cargo-scout-audit + run: cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit + - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} From 1f4c277ab460fcadb5f29122c8231b9f739f65f5 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 18:16:31 -0300 Subject: [PATCH 69/93] Test without minimal --- .github/workflows/test-detectors.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index c4cbcf35..3f2e232b 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -61,7 +61,7 @@ jobs: run: rustup update - name: Install Rust nightly - run: rustup install nightly-2023-12-16 --profile minimal + run: rustup install nightly-2023-12-16 - name: Install dylint, dylint-link and cargo-scout-audit run: cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit @@ -120,7 +120,7 @@ jobs: key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - name: Install Rust nightly - run: rustup install nightly-2023-12-16 --profile minimal + run: rustup install nightly-2023-12-16 - name: Install dylint, dylint-link and cargo-scout-audit run: cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit From a4d8601810965624f57f6b5ff4f69ce03ab57ffd Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 18:27:06 -0300 Subject: [PATCH 70/93] Do cargo build --- .github/workflows/test-detectors.yml | 6 ------ scripts/run-tests.py | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 3f2e232b..447bc042 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -119,12 +119,6 @@ jobs: path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - - name: Install Rust nightly - run: rustup install nightly-2023-12-16 - - - name: Install dylint, dylint-link and cargo-scout-audit - run: cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit - - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 9296a4cf..1b80fe42 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -43,6 +43,12 @@ def run_unit_tests(root): def run_integration_tests(detector, root): start_time = time.time() + + returncode, stdout, stderr = run_subprocess(["cargo", "build"], root) + print("Build returncode:", returncode) + print("Build stdout:", stdout) + print("Build stderr:", stderr) + returncode, stdout, _ = run_subprocess( ["cargo", "scout-audit", "--filter", detector, "--metadata"], root ) From b475b36fcd881d07aedd75083a2565695aba7359 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 18:47:49 -0300 Subject: [PATCH 71/93] Find librustc_driver --- .github/workflows/test-detectors.yml | 5 + Makefile | 23 ++++- detectors/Cargo.toml | 5 +- detectors/test-unsafe-unwrap/Cargo.toml | 16 ++++ detectors/test-unsafe-unwrap/src/lib.rs | 116 ++++++++++++++++++++++++ scripts/run-tests.py | 5 - 6 files changed, 158 insertions(+), 12 deletions(-) create mode 100644 detectors/test-unsafe-unwrap/Cargo.toml create mode 100644 detectors/test-unsafe-unwrap/src/lib.rs diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 447bc042..e2697ced 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -119,6 +119,11 @@ jobs: path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} + - name: Find librustc_driver-*.so + id: find-librustc_driver + run: | + find / -name "librustc_driver-*.so" | head -n 1 + - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} diff --git a/Makefile b/Makefile index a838e462..415c915a 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,32 @@ +.PHONY: ci fmt-rust lint test ci-no-test + ci: fmt-rust lint test -ci-no-test: fmt-rust lint fmt-rust: @echo "Formatting Rust code..." - @python3 scripts/run-fmt.py + @for dir in test-cases/*; do \ + if [ -d "$$dir" ]; then \ + echo "Formatting $$dir..."; \ + python3 scripts/run-fmt.py --dir $$dir; \ + fi; \ + done lint: @echo "Linting detectors and test-cases..." - @python3 scripts/run-clippy.py + @for dir in test-cases/*; do \ + if [ -d "$$dir" ]; then \ + echo "Linting $$dir..."; \ + python3 scripts/run-clippy.py --dir $$dir; \ + fi; \ + done test: - @echo "Generating test matrix and running tests..." + @echo "Running tests..." @for detector in test-cases/*; do \ if [ -d "$$detector" ]; then \ detector_name=$$(basename $$detector); \ python3 scripts/run-tests.py --detector=$$detector_name; \ - fi \ + fi; \ done + +ci-no-test: fmt-rust lint diff --git a/detectors/Cargo.toml b/detectors/Cargo.toml index 8a1e925d..50303457 100644 --- a/detectors/Cargo.toml +++ b/detectors/Cargo.toml @@ -1,10 +1,11 @@ [workspace] members = ["*"] -exclude = [".cargo", "target"] +exclude = [".cargo", "target", "test", "test-unsafe-unwrap"] resolver = "2" [workspace.dependencies] -dylint_linting = { package = "scout-audit-dylint-linting", version = "3.0.0" } +dylint_linting = { version = "3.0.0", package = "scout-audit-dylint-linting"} if_chain = "1.0.2" scout-audit-clippy-utils = { version = "=0.2.3" } + diff --git a/detectors/test-unsafe-unwrap/Cargo.toml b/detectors/test-unsafe-unwrap/Cargo.toml new file mode 100644 index 00000000..ec5e3065 --- /dev/null +++ b/detectors/test-unsafe-unwrap/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "unsafe-unwrap-test" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +dylint_linting = { workspace = true } +if_chain = { workspace = true } + +scout-audit-internal = { workspace = true } + +[package.metadata.rust-analyzer] +rustc_private = true diff --git a/detectors/test-unsafe-unwrap/src/lib.rs b/detectors/test-unsafe-unwrap/src/lib.rs new file mode 100644 index 00000000..ed7e5952 --- /dev/null +++ b/detectors/test-unsafe-unwrap/src/lib.rs @@ -0,0 +1,116 @@ +#![feature(rustc_private)] + +extern crate rustc_ast; +extern crate rustc_hir; +extern crate rustc_span; + +use rustc_hir::{ + def_id::LocalDefId, + intravisit::{walk_expr, FnKind, Visitor}, + Body, Expr, ExprKind, FnDecl, HirId, +}; +use rustc_lint::{LateContext, LateLintPass}; +use rustc_span::{sym, Span, Symbol}; +use scout_audit_internal::{DetectorImpl, SorobanDetector as Detector}; + +dylint_linting::declare_late_lint! { + /// ### What it does + /// Checks for usage of `unwrap` + /// + /// ### Why is this bad? + /// `unwrap` might panic if the result value is an error or `None`. + /// + /// ### Example + /// ```rust + /// // example code where a warning is issued + /// fn main() { + /// let result = result_fn().unwrap("error"); + /// } + /// + /// fn result_fn() -> Result { + /// Err(Error::new(ErrorKind::Other, "error")) + /// } + /// ``` + /// Use instead: + /// ```rust + /// // example code that does not raise a warning + /// fn main() { + /// let result = if let Ok(result) = result_fn() { + /// result + /// } + /// } + /// + /// fn result_fn() -> Result { + /// Err(Error::new(ErrorKind::Other, "error")) + /// } + /// ``` + pub UNSAFE_UNWRAP, + Warn, + "" +} + +struct UnsafeUnwrapVisitor<'a, 'tcx> { + cx: &'a LateContext<'tcx>, + checked_exprs: Vec, + unwrap_spans: Vec, +} + +impl<'tcx> LateLintPass<'tcx> for UnsafeUnwrap { + fn check_fn( + &mut self, + cx: &LateContext<'tcx>, + _: FnKind<'tcx>, + _: &'tcx FnDecl<'tcx>, + body: &'tcx Body<'tcx>, + span: Span, + _: LocalDefId, + ) { + if span.from_expansion() { + return; + } + + let asd = cx.tcx.all_diagnostic_items(()); + println!("diag items {:?}", asd); + + impl<'a, 'tcx> Visitor<'tcx> for UnsafeUnwrapVisitor<'a, 'tcx> { + fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { + if let ExprKind::If(condition, block, _) = &expr.kind { + if let ExprKind::MethodCall(path_segment, args, _, _) = + &condition.peel_drop_temps().kind + { + if path_segment.ident.name == Symbol::intern("is_err") { + if let ExprKind::Block(block, _) = block.kind { + + } + } + } + } + if let ExprKind::MethodCall(path_segment, receiver, _, _) = &expr.kind { + if path_segment.ident.name == sym::unwrap + && !self.checked_exprs.contains(&receiver.hir_id) + { + self.unwrap_spans.push(expr.span); + } + } + walk_expr(self, expr); + } + } + + let mut visitor = UnsafeUnwrapVisitor { + cx, + unwrap_spans: Vec::new(), + checked_exprs: Vec::new(), + }; + + walk_expr(&mut visitor, body.value); + + visitor.unwrap_spans.iter().for_each(|span| { + Detector::UnsafeUnwrap.span_lint_and_help( + cx, + UNSAFE_UNWRAP, + *span, + "Please, use a custom error instead of `unwrap`", + ); + }); + } +} diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 1b80fe42..33291f54 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -44,11 +44,6 @@ def run_unit_tests(root): def run_integration_tests(detector, root): start_time = time.time() - returncode, stdout, stderr = run_subprocess(["cargo", "build"], root) - print("Build returncode:", returncode) - print("Build stdout:", stdout) - print("Build stderr:", stderr) - returncode, stdout, _ = run_subprocess( ["cargo", "scout-audit", "--filter", detector, "--metadata"], root ) From 0d53e32fa299530c5ccc1e0a38ada0297f8d1ac1 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 18:49:27 -0300 Subject: [PATCH 72/93] Revert "Find librustc_driver" This reverts commit b475b36fcd881d07aedd75083a2565695aba7359. --- .github/workflows/test-detectors.yml | 5 - Makefile | 23 +---- detectors/Cargo.toml | 5 +- detectors/test-unsafe-unwrap/Cargo.toml | 16 ---- detectors/test-unsafe-unwrap/src/lib.rs | 116 ------------------------ scripts/run-tests.py | 5 + 6 files changed, 12 insertions(+), 158 deletions(-) delete mode 100644 detectors/test-unsafe-unwrap/Cargo.toml delete mode 100644 detectors/test-unsafe-unwrap/src/lib.rs diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index e2697ced..447bc042 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -119,11 +119,6 @@ jobs: path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - - name: Find librustc_driver-*.so - id: find-librustc_driver - run: | - find / -name "librustc_driver-*.so" | head -n 1 - - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} diff --git a/Makefile b/Makefile index 415c915a..a838e462 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,19 @@ -.PHONY: ci fmt-rust lint test ci-no-test - ci: fmt-rust lint test +ci-no-test: fmt-rust lint fmt-rust: @echo "Formatting Rust code..." - @for dir in test-cases/*; do \ - if [ -d "$$dir" ]; then \ - echo "Formatting $$dir..."; \ - python3 scripts/run-fmt.py --dir $$dir; \ - fi; \ - done + @python3 scripts/run-fmt.py lint: @echo "Linting detectors and test-cases..." - @for dir in test-cases/*; do \ - if [ -d "$$dir" ]; then \ - echo "Linting $$dir..."; \ - python3 scripts/run-clippy.py --dir $$dir; \ - fi; \ - done + @python3 scripts/run-clippy.py test: - @echo "Running tests..." + @echo "Generating test matrix and running tests..." @for detector in test-cases/*; do \ if [ -d "$$detector" ]; then \ detector_name=$$(basename $$detector); \ python3 scripts/run-tests.py --detector=$$detector_name; \ - fi; \ + fi \ done - -ci-no-test: fmt-rust lint diff --git a/detectors/Cargo.toml b/detectors/Cargo.toml index 50303457..8a1e925d 100644 --- a/detectors/Cargo.toml +++ b/detectors/Cargo.toml @@ -1,11 +1,10 @@ [workspace] members = ["*"] -exclude = [".cargo", "target", "test", "test-unsafe-unwrap"] +exclude = [".cargo", "target"] resolver = "2" [workspace.dependencies] -dylint_linting = { version = "3.0.0", package = "scout-audit-dylint-linting"} +dylint_linting = { package = "scout-audit-dylint-linting", version = "3.0.0" } if_chain = "1.0.2" scout-audit-clippy-utils = { version = "=0.2.3" } - diff --git a/detectors/test-unsafe-unwrap/Cargo.toml b/detectors/test-unsafe-unwrap/Cargo.toml deleted file mode 100644 index ec5e3065..00000000 --- a/detectors/test-unsafe-unwrap/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "unsafe-unwrap-test" -version = "0.1.0" -edition = "2021" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -dylint_linting = { workspace = true } -if_chain = { workspace = true } - -scout-audit-internal = { workspace = true } - -[package.metadata.rust-analyzer] -rustc_private = true diff --git a/detectors/test-unsafe-unwrap/src/lib.rs b/detectors/test-unsafe-unwrap/src/lib.rs deleted file mode 100644 index ed7e5952..00000000 --- a/detectors/test-unsafe-unwrap/src/lib.rs +++ /dev/null @@ -1,116 +0,0 @@ -#![feature(rustc_private)] - -extern crate rustc_ast; -extern crate rustc_hir; -extern crate rustc_span; - -use rustc_hir::{ - def_id::LocalDefId, - intravisit::{walk_expr, FnKind, Visitor}, - Body, Expr, ExprKind, FnDecl, HirId, -}; -use rustc_lint::{LateContext, LateLintPass}; -use rustc_span::{sym, Span, Symbol}; -use scout_audit_internal::{DetectorImpl, SorobanDetector as Detector}; - -dylint_linting::declare_late_lint! { - /// ### What it does - /// Checks for usage of `unwrap` - /// - /// ### Why is this bad? - /// `unwrap` might panic if the result value is an error or `None`. - /// - /// ### Example - /// ```rust - /// // example code where a warning is issued - /// fn main() { - /// let result = result_fn().unwrap("error"); - /// } - /// - /// fn result_fn() -> Result { - /// Err(Error::new(ErrorKind::Other, "error")) - /// } - /// ``` - /// Use instead: - /// ```rust - /// // example code that does not raise a warning - /// fn main() { - /// let result = if let Ok(result) = result_fn() { - /// result - /// } - /// } - /// - /// fn result_fn() -> Result { - /// Err(Error::new(ErrorKind::Other, "error")) - /// } - /// ``` - pub UNSAFE_UNWRAP, - Warn, - "" -} - -struct UnsafeUnwrapVisitor<'a, 'tcx> { - cx: &'a LateContext<'tcx>, - checked_exprs: Vec, - unwrap_spans: Vec, -} - -impl<'tcx> LateLintPass<'tcx> for UnsafeUnwrap { - fn check_fn( - &mut self, - cx: &LateContext<'tcx>, - _: FnKind<'tcx>, - _: &'tcx FnDecl<'tcx>, - body: &'tcx Body<'tcx>, - span: Span, - _: LocalDefId, - ) { - if span.from_expansion() { - return; - } - - let asd = cx.tcx.all_diagnostic_items(()); - println!("diag items {:?}", asd); - - impl<'a, 'tcx> Visitor<'tcx> for UnsafeUnwrapVisitor<'a, 'tcx> { - fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { - if let ExprKind::If(condition, block, _) = &expr.kind { - if let ExprKind::MethodCall(path_segment, args, _, _) = - &condition.peel_drop_temps().kind - { - if path_segment.ident.name == Symbol::intern("is_err") { - if let ExprKind::Block(block, _) = block.kind { - - } - } - } - } - if let ExprKind::MethodCall(path_segment, receiver, _, _) = &expr.kind { - if path_segment.ident.name == sym::unwrap - && !self.checked_exprs.contains(&receiver.hir_id) - { - self.unwrap_spans.push(expr.span); - } - } - walk_expr(self, expr); - } - } - - let mut visitor = UnsafeUnwrapVisitor { - cx, - unwrap_spans: Vec::new(), - checked_exprs: Vec::new(), - }; - - walk_expr(&mut visitor, body.value); - - visitor.unwrap_spans.iter().for_each(|span| { - Detector::UnsafeUnwrap.span_lint_and_help( - cx, - UNSAFE_UNWRAP, - *span, - "Please, use a custom error instead of `unwrap`", - ); - }); - } -} diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 33291f54..1b80fe42 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -44,6 +44,11 @@ def run_unit_tests(root): def run_integration_tests(detector, root): start_time = time.time() + returncode, stdout, stderr = run_subprocess(["cargo", "build"], root) + print("Build returncode:", returncode) + print("Build stdout:", stdout) + print("Build stderr:", stderr) + returncode, stdout, _ = run_subprocess( ["cargo", "scout-audit", "--filter", detector, "--metadata"], root ) From a2a43ee8300cfb34ea8f0b69070125fae92cb59b Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Tue, 9 Apr 2024 18:51:57 -0300 Subject: [PATCH 73/93] Find lib rustc driver --- .github/workflows/test-detectors.yml | 5 +++++ scripts/run-tests.py | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 447bc042..e2697ced 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -119,6 +119,11 @@ jobs: path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} + - name: Find librustc_driver-*.so + id: find-librustc_driver + run: | + find / -name "librustc_driver-*.so" | head -n 1 + - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 1b80fe42..33291f54 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -44,11 +44,6 @@ def run_unit_tests(root): def run_integration_tests(detector, root): start_time = time.time() - returncode, stdout, stderr = run_subprocess(["cargo", "build"], root) - print("Build returncode:", returncode) - print("Build stdout:", stdout) - print("Build stderr:", stderr) - returncode, stdout, _ = run_subprocess( ["cargo", "scout-audit", "--filter", detector, "--metadata"], root ) From 927b7e0dee58feb2ea9d42f308582d877523c139 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 10:07:15 -0300 Subject: [PATCH 74/93] Update makefile --- Makefile | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a838e462..98d90f99 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,30 @@ ci: fmt-rust lint test ci-no-test: fmt-rust lint - fmt-rust: @echo "Formatting Rust code..." - @python3 scripts/run-fmt.py + @for dir in test-cases/*; do \ + if [ -d "$$dir" ]; then \ + echo "Formatting $$dir..."; \ + python3 scripts/run-fmt.py --dir $$dir; \ + fi; \ + done lint: @echo "Linting detectors and test-cases..." - @python3 scripts/run-clippy.py + @for dir in test-cases/*; do \ + if [ -d "$$dir" ]; then \ + echo "Linting $$dir..."; \ + python3 scripts/run-clippy.py --dir $$dir; \ + fi; \ + done test: - @echo "Generating test matrix and running tests..." + @echo "Running tests..." @for detector in test-cases/*; do \ if [ -d "$$detector" ]; then \ detector_name=$$(basename $$detector); \ python3 scripts/run-tests.py --detector=$$detector_name; \ - fi \ + fi; \ done + + From 0bd8fdebf909322ac4bbda6f5d7ce8507581920d Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 10:32:50 -0300 Subject: [PATCH 75/93] Run with localdetectors --- scripts/run-tests.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 33291f54..d31d9cab 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -64,7 +64,15 @@ def run_integration_tests(detector, root): short_message = detector_metadata.get(detector_key, {}).get("short_message") returncode, _, stderr = run_subprocess( - ["cargo", "scout-audit", "--filter", detector], root + [ + "cargo", + "scout-audit", + "--filter", + detector, + "--local-detectors", + "../detectors", + ], + root, ) should_lint = root.endswith("vulnerable-example") From 7d587950cc925610166f83df41635b3c4fa49bc6 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 10:34:08 -0300 Subject: [PATCH 76/93] Run on local detectors --- scripts/run-tests.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/run-tests.py b/scripts/run-tests.py index d31d9cab..7ddde29f 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -45,7 +45,16 @@ def run_integration_tests(detector, root): start_time = time.time() returncode, stdout, _ = run_subprocess( - ["cargo", "scout-audit", "--filter", detector, "--metadata"], root + [ + "cargo", + "scout-audit", + "--filter", + detector, + "--metadata", + "--local-detectors", + "../detectors", + ], + root, ) if stdout is None: From ca7934612c58bb408d19a932e741caff8370d1de Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 10:49:32 -0300 Subject: [PATCH 77/93] Remove find *.so --- .github/workflows/test-detectors.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index e2697ced..447bc042 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -119,11 +119,6 @@ jobs: path: ~/.cargo key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - - name: Find librustc_driver-*.so - id: find-librustc_driver - run: | - find / -name "librustc_driver-*.so" | head -n 1 - - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} From 7f11566dcacb4535c7e7a58dca9567bd76cdc774 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 14:26:35 -0300 Subject: [PATCH 78/93] Try fix local detectors flag --- scripts/run-tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 7ddde29f..9a43f5e0 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -52,7 +52,7 @@ def run_integration_tests(detector, root): detector, "--metadata", "--local-detectors", - "../detectors", + os.path.join("detectors"), ], root, ) @@ -79,7 +79,7 @@ def run_integration_tests(detector, root): "--filter", detector, "--local-detectors", - "../detectors", + os.path.join("detectors"), ], root, ) From 739900e087f46dd97feeb4c1a7ce31b220b7922e Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 14:30:04 -0300 Subject: [PATCH 79/93] Test new cache action --- .github/workflows/test-detectors.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 447bc042..58442c84 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -51,11 +51,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Cache cargo dependencies - uses: actions/cache@v4 + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 with: - path: ~/.cargo - key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} + cache-targets: false - name: Update Rust Toolchain run: rustup update @@ -113,11 +112,10 @@ jobs: with: python-version: "3.9" - - name: Cache cargo dependencies - uses: actions/cache@v4 + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 with: - path: ~/.cargo - key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} + cache-targets: false - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} From 7c55a237da2851aecb353701b2ba751b33e537e5 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 15:02:20 -0300 Subject: [PATCH 80/93] Test new cache strategy --- .github/workflows/test-detectors.yml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 58442c84..d13d5756 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -51,10 +51,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Cache Rust dependencies - uses: Swatinem/rust-cache@v2 + - name: Cache cargo dependencies and tool versions + uses: actions/cache@v4 with: - cache-targets: false + path: | + ~/.cargo + versions.txt + key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock', 'versions.txt') }} - name: Update Rust Toolchain run: rustup update @@ -63,7 +66,11 @@ jobs: run: rustup install nightly-2023-12-16 - name: Install dylint, dylint-link and cargo-scout-audit - run: cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit + run: | + cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit + cargo +nightly-2023-12-16 dylint --version > versions.txt + cargo +nightly-2023-12-16 dylint-link --version >> versions.txt + cargo +nightly-2023-12-16 scout-audit --version >> versions.txt - name: Determine build status and write to file run: echo "${{ job.status }}" > status-${{ matrix.os }}.txt @@ -112,10 +119,13 @@ jobs: with: python-version: "3.9" - - name: Cache Rust dependencies - uses: Swatinem/rust-cache@v2 + - name: Cache cargo dependencies and tool versions + uses: actions/cache@v4 with: - cache-targets: false + path: | + ~/.cargo + versions.txt + key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock', 'versions.txt') }} - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} From 2e03bf3f9c789ae740758ee87351dfceabcf8134 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 15:25:08 -0300 Subject: [PATCH 81/93] Cache --- .github/workflows/test-detectors.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index d13d5756..dd090fa7 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -56,8 +56,9 @@ jobs: with: path: | ~/.cargo - versions.txt - key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock', 'versions.txt') }} + checksum.txt + key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-tests- - name: Update Rust Toolchain run: rustup update @@ -66,11 +67,7 @@ jobs: run: rustup install nightly-2023-12-16 - name: Install dylint, dylint-link and cargo-scout-audit - run: | - cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit - cargo +nightly-2023-12-16 dylint --version > versions.txt - cargo +nightly-2023-12-16 dylint-link --version >> versions.txt - cargo +nightly-2023-12-16 scout-audit --version >> versions.txt + run: cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit - name: Determine build status and write to file run: echo "${{ job.status }}" > status-${{ matrix.os }}.txt @@ -122,10 +119,9 @@ jobs: - name: Cache cargo dependencies and tool versions uses: actions/cache@v4 with: - path: | - ~/.cargo - versions.txt - key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock', 'versions.txt') }} + path: ~/.cargo + key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-tests- - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} From 817c9fe4705fcc514e207f5a45c4c2cc6b113209 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 15:46:55 -0300 Subject: [PATCH 82/93] Test rust-actions --- .github/workflows/general-rust.yml | 34 +++++++++++++--------------- .github/workflows/test-detectors.yml | 5 ++-- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index b2d21e80..8d8b3fcd 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -29,16 +29,15 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - - name: Update Rust Toolchain - run: rustup update - - - name: Install Rust nightly - run: rustup install nightly --profile minimal - - - name: Install rustfmt - run: rustup component add rustfmt --toolchain nightly + - name: Install rust toolchain and components + uses: actions-rs/toolchain@v1 + with: + components: rustfmt + default: true + profile: minimal + toolchain: nightly - name: Check Format run: python scripts/run-fmt.py --dir test-cases detectors @@ -55,7 +54,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: Cache Rust Dependencies uses: actions/cache@v4 @@ -65,18 +64,17 @@ jobs: ~/.rustup key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} - - name: Update Rust Toolchain - run: rustup update - - - name: Install Rust nightly - run: rustup install nightly-2023-12-16 --profile minimal + - name: Install rust toolchain and components + uses: actions-rs/toolchain@v1 + with: + components: clippy + default: true + profile: minimal + toolchain: nightly-2023-12-16 - name: Install dylint-link run: cargo install dylint-link - - name: Install clippy - run: rustup component add clippy --toolchain nightly-2023-12-16 - - name: Lint with Clippy run: python scripts/run-clippy.py --dir test-cases detectors diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index dd090fa7..82aa19ec 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -30,7 +30,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: Install dependencies run: pip install fuzzywuzzy @@ -56,7 +56,6 @@ jobs: with: path: | ~/.cargo - checksum.txt key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-tests- @@ -114,7 +113,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.9" + python-version: "3.10" - name: Cache cargo dependencies and tool versions uses: actions/cache@v4 From be08a346a9a0e5972e9772807f2b4616cd581f90 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 16:19:06 -0300 Subject: [PATCH 83/93] Try cache with binaries hash --- .github/workflows/general-rust.yml | 30 +++++++++++++++------------- .github/workflows/test-detectors.yml | 14 +++++++------ 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/general-rust.yml b/.github/workflows/general-rust.yml index 8d8b3fcd..5f858716 100644 --- a/.github/workflows/general-rust.yml +++ b/.github/workflows/general-rust.yml @@ -31,13 +31,14 @@ jobs: with: python-version: "3.10" - - name: Install rust toolchain and components - uses: actions-rs/toolchain@v1 - with: - components: rustfmt - default: true - profile: minimal - toolchain: nightly + - name: Update Rust Toolchain + run: rustup update + + - name: Install Rust nightly + run: rustup install nightly --profile minimal + + - name: Install rustfmt + run: rustup component add rustfmt --toolchain nightly - name: Check Format run: python scripts/run-fmt.py --dir test-cases detectors @@ -64,17 +65,18 @@ jobs: ~/.rustup key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} - - name: Install rust toolchain and components - uses: actions-rs/toolchain@v1 - with: - components: clippy - default: true - profile: minimal - toolchain: nightly-2023-12-16 + - name: Update Rust Toolchain + run: rustup update + + - name: Install Rust nightly + run: rustup install nightly-2023-12-16 --profile minimal - name: Install dylint-link run: cargo install dylint-link + - name: Install clippy + run: rustup component add clippy --toolchain nightly-2023-12-16 + - name: Lint with Clippy run: python scripts/run-clippy.py --dir test-cases detectors diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 82aa19ec..a0b4d243 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -54,10 +54,9 @@ jobs: - name: Cache cargo dependencies and tool versions uses: actions/cache@v4 with: - path: | - ~/.cargo - key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-tests- + path: ~/.cargo + key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }}-binaries-${{ hashFiles('~/hash.txt') }} + restore-keys: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }}- - name: Update Rust Toolchain run: rustup update @@ -68,6 +67,9 @@ jobs: - name: Install dylint, dylint-link and cargo-scout-audit run: cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit + - name: Hash binaries + run: sha256sum ~/.cargo/bin/* > ~/hash.txt + - name: Determine build status and write to file run: echo "${{ job.status }}" > status-${{ matrix.os }}.txt @@ -119,8 +121,8 @@ jobs: uses: actions/cache@v4 with: path: ~/.cargo - key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-tests- + key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }}-binaries-${{ hashFiles('~/hash.txt') }} + restore-keys: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }}- - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} From 11fc44b83777ffd2fcde72c11a9243ffb3f9e08f Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 16:53:40 -0300 Subject: [PATCH 84/93] Try fix local-detectors path, remove cache by binaries --- .github/workflows/test-detectors.yml | 12 +++++------- Makefile | 11 ++++------- scripts/run-tests.py | 4 ++-- scripts/utils.py | 4 ---- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index a0b4d243..4d131d63 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -55,8 +55,8 @@ jobs: uses: actions/cache@v4 with: path: ~/.cargo - key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }}-binaries-${{ hashFiles('~/hash.txt') }} - restore-keys: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }}- + key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-tests- - name: Update Rust Toolchain run: rustup update @@ -67,9 +67,6 @@ jobs: - name: Install dylint, dylint-link and cargo-scout-audit run: cargo +nightly-2023-12-16 install cargo-dylint dylint-link cargo-scout-audit - - name: Hash binaries - run: sha256sum ~/.cargo/bin/* > ~/hash.txt - - name: Determine build status and write to file run: echo "${{ job.status }}" > status-${{ matrix.os }}.txt @@ -93,6 +90,7 @@ jobs: working-directory: test-cases run: | matrix=$(find . -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | jq -R -cs 'split("\n")[:-1]') + echo "Matrix: $matrix" echo "matrix=$matrix" >> $GITHUB_OUTPUT test: @@ -121,8 +119,8 @@ jobs: uses: actions/cache@v4 with: path: ~/.cargo - key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }}-binaries-${{ hashFiles('~/hash.txt') }} - restore-keys: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }}- + key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-tests- - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} diff --git a/Makefile b/Makefile index 98d90f99..f59878f8 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,27 @@ ci: fmt-rust lint test ci-no-test: fmt-rust lint + fmt-rust: - @echo "Formatting Rust code..." + @echo "\nFormatting Rust code..." @for dir in test-cases/*; do \ if [ -d "$$dir" ]; then \ - echo "Formatting $$dir..."; \ python3 scripts/run-fmt.py --dir $$dir; \ fi; \ done lint: - @echo "Linting detectors and test-cases..." + @echo "\nLinting detectors and test-cases..." @for dir in test-cases/*; do \ if [ -d "$$dir" ]; then \ - echo "Linting $$dir..."; \ python3 scripts/run-clippy.py --dir $$dir; \ fi; \ done test: - @echo "Running tests..." + @echo "\nRunning tests..." @for detector in test-cases/*; do \ if [ -d "$$detector" ]; then \ - detector_name=$$(basename $$detector); \ python3 scripts/run-tests.py --detector=$$detector_name; \ fi; \ done - diff --git a/scripts/run-tests.py b/scripts/run-tests.py index 9a43f5e0..8fd11f43 100644 --- a/scripts/run-tests.py +++ b/scripts/run-tests.py @@ -52,7 +52,7 @@ def run_integration_tests(detector, root): detector, "--metadata", "--local-detectors", - os.path.join("detectors"), + os.path.join(os.getcwd(), "detectors"), ], root, ) @@ -79,7 +79,7 @@ def run_integration_tests(detector, root): "--filter", detector, "--local-detectors", - os.path.join("detectors"), + os.path.join(os.getcwd(), "detectors"), ], root, ) diff --git a/scripts/utils.py b/scripts/utils.py index 061271cc..25247f87 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -35,10 +35,6 @@ def parse_json_from_string(console_output): def run_subprocess(command: list, cwd: str): result = subprocess.run(command, cwd=cwd, capture_output=True, text=True) - print(f"Running command: {command} in {cwd}") - print(f"Return code: {result.returncode}") - print(f"stdout: {result.stdout}") - print(f"stderr: {result.stderr}") stdout = result.stdout.strip() if result.stdout else None stderr = result.stderr.strip() if result.stderr else None return (result.returncode, stdout, stderr) From d2e34fb4fd73af9f4fd56b2cd955a63466727040 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 17:10:06 -0300 Subject: [PATCH 85/93] Print statements to debug --- Makefile | 31 ++++++++++++++++++++++--------- scripts/utils.py | 4 ++++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index f59878f8..93dbcf2f 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,40 @@ -ci: fmt-rust lint test -ci-no-test: fmt-rust lint +ci: fmt lint test +ci-no-test: fmt lint -fmt-rust: - @echo "\nFormatting Rust code..." +fmt: + @echo "\nFormatting test cases..." @for dir in test-cases/*; do \ if [ -d "$$dir" ]; then \ python3 scripts/run-fmt.py --dir $$dir; \ fi; \ done + @echo "\nFormatting detectors..." + @for dir in detectors/*; do \ + if [ -d "$$dir" ]; then \ + python3 scripts/run-fmt.py --dir $$dir; \ + fi; \ + done + lint: - @echo "\nLinting detectors and test-cases..." + @echo "\nLinting test cases..." @for dir in test-cases/*; do \ if [ -d "$$dir" ]; then \ python3 scripts/run-clippy.py --dir $$dir; \ fi; \ done + @echo "\nLinting detectors..." + @for dir in detectors/*; do \ + if [ -d "$$dir" ]; then \ + python3 scripts/run-clippy.py --dir $$dir; \ + fi; \ + done test: - @echo "\nRunning tests..." - @for detector in test-cases/*; do \ - if [ -d "$$detector" ]; then \ + @echo "\nRunning tests for test cases..." + @for dir in test-cases/*; do \ + if [ -d "$$dir" ]; then \ + detector_name=$$(basename "$$dir"); \ python3 scripts/run-tests.py --detector=$$detector_name; \ fi; \ done - diff --git a/scripts/utils.py b/scripts/utils.py index 25247f87..1b7f9077 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -37,6 +37,10 @@ def run_subprocess(command: list, cwd: str): result = subprocess.run(command, cwd=cwd, capture_output=True, text=True) stdout = result.stdout.strip() if result.stdout else None stderr = result.stderr.strip() if result.stderr else None + print(f"Command: {command}") + print(f"Return code: {result.returncode}") + print(f"stdout: {stdout}") + print(f"stderr: {stderr}") return (result.returncode, stdout, stderr) From 94f3f822913cc08163a291e240549579f5f9ad82 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Wed, 10 Apr 2024 17:17:07 -0300 Subject: [PATCH 86/93] Debug --- .github/workflows/test-detectors.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 4d131d63..472383fc 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -122,6 +122,11 @@ jobs: key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-tests- + - run: rustup show + + - name: Install Rust nightly + run: rustup install nightly-2023-12-16 + - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} From ad7a667017fa1d37f03f215afeb6fbe9d23740f3 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Thu, 11 Apr 2024 09:57:38 -0300 Subject: [PATCH 87/93] Cargo clean on tests, cache rustup on build --- .github/workflows/test-detectors.yml | 8 ++++++-- scripts/run-clippy.py | 4 ++++ scripts/utils.py | 4 ---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 472383fc..063d9714 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -54,7 +54,9 @@ jobs: - name: Cache cargo dependencies and tool versions uses: actions/cache@v4 with: - path: ~/.cargo + path: | + ~/.cargo + ~/.rustup key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-tests- @@ -118,7 +120,9 @@ jobs: - name: Cache cargo dependencies and tool versions uses: actions/cache@v4 with: - path: ~/.cargo + path: | + ~/.cargo + ~/.rustup key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-tests- diff --git a/scripts/run-clippy.py b/scripts/run-clippy.py index ddbc08cb..885661cd 100644 --- a/scripts/run-clippy.py +++ b/scripts/run-clippy.py @@ -36,6 +36,10 @@ def run_clippy(directories): print_results( returncode, stderr, "clippy", root, time.time() - start_time ) + + if root.startswith("test-cases"): + run_subprocess(["cargo", "clean"], cwd=root) + if returncode != 0: errors.append(root) diff --git a/scripts/utils.py b/scripts/utils.py index 1b7f9077..25247f87 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -37,10 +37,6 @@ def run_subprocess(command: list, cwd: str): result = subprocess.run(command, cwd=cwd, capture_output=True, text=True) stdout = result.stdout.strip() if result.stdout else None stderr = result.stderr.strip() if result.stderr else None - print(f"Command: {command}") - print(f"Return code: {result.returncode}") - print(f"stdout: {stdout}") - print(f"stderr: {stderr}") return (result.returncode, stdout, stderr) From 7388b09f17b12231fb0d16851452bcbcc6dc611b Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Thu, 11 Apr 2024 10:34:20 -0300 Subject: [PATCH 88/93] Remove unneeded stuff --- .github/workflows/test-detectors.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/test-detectors.yml b/.github/workflows/test-detectors.yml index 063d9714..a5f7be4a 100644 --- a/.github/workflows/test-detectors.yml +++ b/.github/workflows/test-detectors.yml @@ -48,9 +48,6 @@ jobs: - macos-latest runs-on: ${{ matrix.os }} steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Cache cargo dependencies and tool versions uses: actions/cache@v4 with: @@ -60,9 +57,6 @@ jobs: key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-tests- - - name: Update Rust Toolchain - run: rustup update - - name: Install Rust nightly run: rustup install nightly-2023-12-16 @@ -126,11 +120,6 @@ jobs: key: ${{ runner.os }}-tests-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-tests- - - run: rustup show - - - name: Install Rust nightly - run: rustup install nightly-2023-12-16 - - name: Run unit and integration tests run: python scripts/run-tests.py --detector=${{ matrix.detector }} From fc971b1d6580f8067a0e01e98384d73799ca3c54 Mon Sep 17 00:00:00 2001 From: Jose Garcia Crosta Date: Thu, 11 Apr 2024 11:20:10 -0300 Subject: [PATCH 89/93] Delete apps, clippy-utils and scout-internal --- apps/cargo-scout-audit/Cargo.lock | 3275 ----------------- apps/cargo-scout-audit/Cargo.toml | 48 - apps/cargo-scout-audit/src/detectors.rs | 90 - .../src/detectors/builder.rs | 161 - .../src/detectors/configuration.rs | 42 - .../src/detectors/library.rs | 95 - .../src/detectors/source/git.rs | 64 - .../src/detectors/source/mod.rs | 3 - apps/cargo-scout-audit/src/lib.rs | 3 - apps/cargo-scout-audit/src/main.rs | 11 - apps/cargo-scout-audit/src/startup.rs | 260 -- apps/cargo-scout-audit/src/utils/cargo.rs | 51 - .../src/utils/cargo_package.rs | 10 - apps/cargo-scout-audit/src/utils/command.rs | 129 - apps/cargo-scout-audit/src/utils/detectors.rs | 60 - apps/cargo-scout-audit/src/utils/env.rs | 31 - apps/cargo-scout-audit/src/utils/mod.rs | 7 - apps/cargo-scout-audit/src/utils/output.rs | 201 - apps/cargo-scout-audit/src/utils/rustup.rs | 23 - apps/cargo-scout-audit/tests/README.md | 39 - .../tests/integration_tests/detectors.rs | 148 - .../detectors/configuration.rs | 111 - .../integration_tests/detectors/utils.rs | 14 - .../tests/integration_tests/main.rs | 1 - apps/scout-extension/.eslintrc.cjs | 31 - apps/scout-extension/.gitignore | 2 - apps/scout-extension/.npmrc | 1 - apps/scout-extension/.prettierignore | 2 - apps/scout-extension/.vscodeignore | 10 - apps/scout-extension/CHANGELOG.md | 9 - apps/scout-extension/LICENSE | 21 - apps/scout-extension/README.md | 43 - apps/scout-extension/images/icon.png | Bin 13073 -> 0 bytes apps/scout-extension/package.json | 58 - apps/scout-extension/pnpm-lock.yaml | 1656 --------- apps/scout-extension/src/extension.ts | 85 - apps/scout-extension/src/test/runTest.ts | 26 - .../src/test/suite/extension.test.ts | 15 - apps/scout-extension/src/test/suite/index.ts | 38 - apps/scout-extension/tsconfig.json | 18 - scout-audit-clippy-utils/Cargo.lock | 46 - scout-audit-clippy-utils/Cargo.toml | 21 - scout-audit-clippy-utils/README.md | 9 - scout-audit-clippy-utils/rust-toolchain | 3 - scout-audit-clippy-utils/src/ast_utils.rs | 786 ---- .../src/ast_utils/ident_iter.rs | 45 - scout-audit-clippy-utils/src/attrs.rs | 158 - .../src/check_proc_macro.rs | 434 --- scout-audit-clippy-utils/src/comparisons.rs | 36 - scout-audit-clippy-utils/src/consts.rs | 733 ---- scout-audit-clippy-utils/src/diagnostics.rs | 238 -- scout-audit-clippy-utils/src/eager_or_lazy.rs | 274 -- scout-audit-clippy-utils/src/higher.rs | 469 --- scout-audit-clippy-utils/src/hir_utils.rs | 1158 ------ scout-audit-clippy-utils/src/lib.rs | 2915 --------------- scout-audit-clippy-utils/src/macros.rs | 538 --- scout-audit-clippy-utils/src/mir/mod.rs | 195 - .../src/mir/possible_borrower.rs | 243 -- .../src/mir/possible_origin.rs | 59 - .../src/mir/transitive_relation.rs | 29 - scout-audit-clippy-utils/src/msrvs.rs | 148 - .../src/numeric_literal.rs | 247 -- scout-audit-clippy-utils/src/paths.rs | 167 - scout-audit-clippy-utils/src/ptr.rs | 52 - .../src/qualify_min_const_fn.rs | 429 --- scout-audit-clippy-utils/src/source.rs | 598 --- scout-audit-clippy-utils/src/str_utils.rs | 325 -- scout-audit-clippy-utils/src/sugg.rs | 1111 ------ scout-audit-clippy-utils/src/sym_helper.rs | 7 - scout-audit-clippy-utils/src/ty.rs | 1268 ------- .../src/ty/type_certainty/certainty.rs | 122 - .../src/ty/type_certainty/mod.rs | 321 -- scout-audit-clippy-utils/src/usage.rs | 210 -- scout-audit-clippy-utils/src/visitors.rs | 750 ---- scout-audit-internal/Cargo.toml | 31 - scout-audit-internal/rust-toolchain | 3 - scout-audit-internal/src/detector.rs | 126 - .../src/detector/lint_message.rs | 19 - scout-audit-internal/src/lib.rs | 11 - 79 files changed, 21226 deletions(-) delete mode 100644 apps/cargo-scout-audit/Cargo.lock delete mode 100644 apps/cargo-scout-audit/Cargo.toml delete mode 100644 apps/cargo-scout-audit/src/detectors.rs delete mode 100644 apps/cargo-scout-audit/src/detectors/builder.rs delete mode 100644 apps/cargo-scout-audit/src/detectors/configuration.rs delete mode 100644 apps/cargo-scout-audit/src/detectors/library.rs delete mode 100644 apps/cargo-scout-audit/src/detectors/source/git.rs delete mode 100644 apps/cargo-scout-audit/src/detectors/source/mod.rs delete mode 100644 apps/cargo-scout-audit/src/lib.rs delete mode 100644 apps/cargo-scout-audit/src/main.rs delete mode 100644 apps/cargo-scout-audit/src/startup.rs delete mode 100644 apps/cargo-scout-audit/src/utils/cargo.rs delete mode 100644 apps/cargo-scout-audit/src/utils/cargo_package.rs delete mode 100644 apps/cargo-scout-audit/src/utils/command.rs delete mode 100644 apps/cargo-scout-audit/src/utils/detectors.rs delete mode 100644 apps/cargo-scout-audit/src/utils/env.rs delete mode 100644 apps/cargo-scout-audit/src/utils/mod.rs delete mode 100644 apps/cargo-scout-audit/src/utils/output.rs delete mode 100644 apps/cargo-scout-audit/src/utils/rustup.rs delete mode 100644 apps/cargo-scout-audit/tests/README.md delete mode 100644 apps/cargo-scout-audit/tests/integration_tests/detectors.rs delete mode 100644 apps/cargo-scout-audit/tests/integration_tests/detectors/configuration.rs delete mode 100644 apps/cargo-scout-audit/tests/integration_tests/detectors/utils.rs delete mode 100644 apps/cargo-scout-audit/tests/integration_tests/main.rs delete mode 100644 apps/scout-extension/.eslintrc.cjs delete mode 100644 apps/scout-extension/.gitignore delete mode 100644 apps/scout-extension/.npmrc delete mode 100644 apps/scout-extension/.prettierignore delete mode 100644 apps/scout-extension/.vscodeignore delete mode 100644 apps/scout-extension/CHANGELOG.md delete mode 100644 apps/scout-extension/LICENSE delete mode 100644 apps/scout-extension/README.md delete mode 100644 apps/scout-extension/images/icon.png delete mode 100644 apps/scout-extension/package.json delete mode 100644 apps/scout-extension/pnpm-lock.yaml delete mode 100644 apps/scout-extension/src/extension.ts delete mode 100644 apps/scout-extension/src/test/runTest.ts delete mode 100644 apps/scout-extension/src/test/suite/extension.test.ts delete mode 100644 apps/scout-extension/src/test/suite/index.ts delete mode 100644 apps/scout-extension/tsconfig.json delete mode 100644 scout-audit-clippy-utils/Cargo.lock delete mode 100644 scout-audit-clippy-utils/Cargo.toml delete mode 100644 scout-audit-clippy-utils/README.md delete mode 100644 scout-audit-clippy-utils/rust-toolchain delete mode 100644 scout-audit-clippy-utils/src/ast_utils.rs delete mode 100644 scout-audit-clippy-utils/src/ast_utils/ident_iter.rs delete mode 100644 scout-audit-clippy-utils/src/attrs.rs delete mode 100644 scout-audit-clippy-utils/src/check_proc_macro.rs delete mode 100644 scout-audit-clippy-utils/src/comparisons.rs delete mode 100644 scout-audit-clippy-utils/src/consts.rs delete mode 100644 scout-audit-clippy-utils/src/diagnostics.rs delete mode 100644 scout-audit-clippy-utils/src/eager_or_lazy.rs delete mode 100644 scout-audit-clippy-utils/src/higher.rs delete mode 100644 scout-audit-clippy-utils/src/hir_utils.rs delete mode 100644 scout-audit-clippy-utils/src/lib.rs delete mode 100644 scout-audit-clippy-utils/src/macros.rs delete mode 100644 scout-audit-clippy-utils/src/mir/mod.rs delete mode 100644 scout-audit-clippy-utils/src/mir/possible_borrower.rs delete mode 100644 scout-audit-clippy-utils/src/mir/possible_origin.rs delete mode 100644 scout-audit-clippy-utils/src/mir/transitive_relation.rs delete mode 100644 scout-audit-clippy-utils/src/msrvs.rs delete mode 100644 scout-audit-clippy-utils/src/numeric_literal.rs delete mode 100644 scout-audit-clippy-utils/src/paths.rs delete mode 100644 scout-audit-clippy-utils/src/ptr.rs delete mode 100644 scout-audit-clippy-utils/src/qualify_min_const_fn.rs delete mode 100644 scout-audit-clippy-utils/src/source.rs delete mode 100644 scout-audit-clippy-utils/src/str_utils.rs delete mode 100644 scout-audit-clippy-utils/src/sugg.rs delete mode 100644 scout-audit-clippy-utils/src/sym_helper.rs delete mode 100644 scout-audit-clippy-utils/src/ty.rs delete mode 100644 scout-audit-clippy-utils/src/ty/type_certainty/certainty.rs delete mode 100644 scout-audit-clippy-utils/src/ty/type_certainty/mod.rs delete mode 100644 scout-audit-clippy-utils/src/usage.rs delete mode 100644 scout-audit-clippy-utils/src/visitors.rs delete mode 100644 scout-audit-internal/Cargo.toml delete mode 100644 scout-audit-internal/rust-toolchain delete mode 100644 scout-audit-internal/src/detector.rs delete mode 100644 scout-audit-internal/src/detector/lint_message.rs delete mode 100644 scout-audit-internal/src/lib.rs diff --git a/apps/cargo-scout-audit/Cargo.lock b/apps/cargo-scout-audit/Cargo.lock deleted file mode 100644 index cf8e213b..00000000 --- a/apps/cargo-scout-audit/Cargo.lock +++ /dev/null @@ -1,3275 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" -dependencies = [ - "memchr", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "anstream" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" - -[[package]] -name = "anstyle-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" -dependencies = [ - "windows-sys 0.48.0", -] - -[[package]] -name = "anstyle-wincon" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" -dependencies = [ - "anstyle", - "windows-sys 0.48.0", -] - -[[package]] -name = "anyhow" -version = "1.0.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" - -[[package]] -name = "arc-swap" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "async-trait" -version = "0.1.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" - -[[package]] -name = "bitmaps" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" -dependencies = [ - "typenum", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bstr" -version = "1.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" -dependencies = [ - "memchr", - "regex-automata", - "serde", -] - -[[package]] -name = "btoi" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" -dependencies = [ - "num-traits", -] - -[[package]] -name = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" - -[[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "bytesize" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo" -version = "0.72.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "171aca76a3199e771ea0b94ec260984ed9cba62af8e478142974dbaa594d583b" -dependencies = [ - "anyhow", - "base64 0.21.3", - "bytesize", - "cargo-platform", - "cargo-util", - "clap", - "crates-io", - "curl", - "curl-sys", - "env_logger", - "filetime", - "flate2", - "fwdansi", - "git2", - "git2-curl", - "gix", - "gix-features", - "glob", - "hex", - "hmac", - "home", - "http-auth", - "humantime", - "ignore", - "im-rc", - "indexmap 1.9.3", - "is-terminal", - "itertools 0.10.5", - "jobserver", - "lazy_static", - "lazycell", - "libc", - "libgit2-sys", - "log", - "memchr", - "opener", - "os_info", - "pasetors", - "pathdiff", - "rand", - "rustfix", - "semver", - "serde", - "serde-value", - "serde_ignored", - "serde_json", - "sha1", - "shell-escape", - "strip-ansi-escapes", - "tar", - "tempfile", - "termcolor", - "time", - "toml 0.7.7", - "toml_edit", - "unicode-width", - "unicode-xid", - "url", - "walkdir", - "windows-sys 0.48.0", -] - -[[package]] -name = "cargo-platform" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-scout-audit" -version = "0.2.1" -dependencies = [ - "ansi_term", - "anyhow", - "cargo", - "cargo_metadata", - "clap", - "colored", - "config", - "dunce", - "dylint", - "env_logger", - "home", - "itertools 0.11.0", - "log", - "regex", - "scout-audit-internal", - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "cargo-util" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd54c8b94a0c851d687924460637361c355afafa72d973fe8644499fbdee8fae" -dependencies = [ - "anyhow", - "core-foundation", - "filetime", - "hex", - "jobserver", - "libc", - "log", - "miow", - "same-file", - "sha2", - "shell-escape", - "tempfile", - "walkdir", - "windows-sys 0.48.0", -] - -[[package]] -name = "cargo_metadata" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "jobserver", - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", - "terminal_size", -] - -[[package]] -name = "clap_derive" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.31", -] - -[[package]] -name = "clap_lex" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" - -[[package]] -name = "clru" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8191fa7302e03607ff0e237d4246cc043ff5b3cb9409d995172ba3bea16b807" - -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - -[[package]] -name = "colored" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" -dependencies = [ - "is-terminal", - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "config" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" -dependencies = [ - "async-trait", - "json5", - "lazy_static", - "nom", - "pathdiff", - "ron", - "rust-ini", - "serde", - "serde_json", - "toml 0.5.11", - "yaml-rust", -] - -[[package]] -name = "const-oid" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - -[[package]] -name = "cpufeatures" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" -dependencies = [ - "libc", -] - -[[package]] -name = "crates-io" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876aa69b4afca5f2eb5e23daa3445930faf829bcb67075a20ffa884f11f8c57c" -dependencies = [ - "anyhow", - "curl", - "percent-encoding", - "serde", - "serde_json", - "url", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crypto-bigint" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "ct-codecs" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3b7eb4404b8195a9abb6356f4ac07d8ba267045c8d6d220ac4dc992e6cc75df" - -[[package]] -name = "curl" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" -dependencies = [ - "curl-sys", - "libc", - "openssl-probe", - "openssl-sys", - "schannel", - "socket2", - "winapi", -] - -[[package]] -name = "curl-sys" -version = "0.4.65+curl-8.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "961ba061c9ef2fe34bbd12b807152d96f0badd2bebe7b90ce6c8c8b7572a0986" -dependencies = [ - "cc", - "libc", - "libnghttp2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", - "winapi", -] - -[[package]] -name = "der" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "dlv-list" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "dylint" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01428e3fad655202ec50df7b66015d59f7a66d76c9d0eba7148fc057c1008b08" -dependencies = [ - "ansi_term", - "anyhow", - "cargo", - "cargo-platform", - "cargo-util", - "cargo_metadata", - "dirs", - "dylint_internal", - "glob", - "heck", - "if_chain", - "is-terminal", - "log", - "once_cell", - "semver", - "serde", - "serde_json", - "tempfile", - "toml 0.7.7", - "walkdir", -] - -[[package]] -name = "dylint_internal" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510bc05a42055d62ed89ee9561d974f338d30bf786917da7c033146a860ceac1" -dependencies = [ - "ansi_term", - "anyhow", - "cargo_metadata", - "git2", - "home", - "if_chain", - "is-terminal", - "log", - "rust-embed", - "sedregex", -] - -[[package]] -name = "ecdsa" -version = "0.16.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" -dependencies = [ - "der", - "digest", - "elliptic-curve", - "rfc6979", - "signature", - "spki", -] - -[[package]] -name = "ed25519-compact" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a3d382e8464107391c8706b4c14b087808ecb909f6c15c34114bc42e53a9e4c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "elliptic-curve" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest", - "ff", - "generic-array", - "group", - "hkdf", - "pem-rfc7468", - "pkcs8", - "rand_core", - "sec1", - "subtle", - "zeroize", -] - -[[package]] -name = "env_logger" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "faster-hex" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239f7bfb930f820ab16a9cd95afc26f88264cf6905c960b340a615384aa3338a" -dependencies = [ - "serde", -] - -[[package]] -name = "fastrand" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" - -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "rand_core", - "subtle", -] - -[[package]] -name = "fiat-crypto" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" - -[[package]] -name = "filetime" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", -] - -[[package]] -name = "flate2" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" -dependencies = [ - "crc32fast", - "libz-sys", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fwdansi" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c1f5787fe85505d1f7777268db5103d80a7a374d2316a7ce262e57baf8f208" -dependencies = [ - "memchr", - "termcolor", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "getrandom" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - -[[package]] -name = "git2" -version = "0.17.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b989d6a7ca95a362cf2cfc5ad688b3a467be1f87e480b8dad07fee8c79b0044" -dependencies = [ - "bitflags 1.3.2", - "libc", - "libgit2-sys", - "log", - "openssl-probe", - "openssl-sys", - "url", -] - -[[package]] -name = "git2-curl" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f8b7432b72928cff76f69e59ed5327f94a52763731e71274960dee72fe5f8c" -dependencies = [ - "curl", - "git2", - "log", - "url", -] - -[[package]] -name = "gix" -version = "0.44.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf41b61f7df395284f7a579c0fa1a7e012c5aede655174d4e91299ef1cac643" -dependencies = [ - "gix-actor", - "gix-attributes", - "gix-config", - "gix-credentials", - "gix-date", - "gix-diff", - "gix-discover", - "gix-features", - "gix-fs", - "gix-glob", - "gix-hash", - "gix-hashtable", - "gix-ignore", - "gix-index", - "gix-lock", - "gix-mailmap", - "gix-object", - "gix-odb", - "gix-pack", - "gix-path", - "gix-prompt", - "gix-protocol", - "gix-ref", - "gix-refspec", - "gix-revision", - "gix-sec", - "gix-tempfile", - "gix-transport", - "gix-traverse", - "gix-url", - "gix-utils", - "gix-validate", - "gix-worktree", - "log", - "once_cell", - "prodash", - "signal-hook", - "smallvec", - "thiserror", - "unicode-normalization", -] - -[[package]] -name = "gix-actor" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "848efa0f1210cea8638f95691c82a46f98a74b9e3524f01d4955ebc25a8f84f3" -dependencies = [ - "bstr", - "btoi", - "gix-date", - "itoa", - "nom", - "thiserror", -] - -[[package]] -name = "gix-attributes" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3015baa01ad2122fbcaab7863c857a603eb7b7ec12ac8141207c42c6439805e2" -dependencies = [ - "bstr", - "gix-glob", - "gix-path", - "gix-quote", - "kstring", - "log", - "smallvec", - "thiserror", - "unicode-bom", -] - -[[package]] -name = "gix-bitmap" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ccab4bc576844ddb51b78d81b4a42d73e6229660fa614dfc3d3999c874d1959" -dependencies = [ - "thiserror", -] - -[[package]] -name = "gix-chunk" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b42ea64420f7994000130328f3c7a2038f639120518870436d31b8bde704493" -dependencies = [ - "thiserror", -] - -[[package]] -name = "gix-command" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f28f654184b5f725c5737c7e4f466cbd8f0102ac352d5257eeab19647ee4256" -dependencies = [ - "bstr", -] - -[[package]] -name = "gix-config" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d252a0eddb6df74600d3d8872dc9fe98835a7da43110411d705b682f49d4ac1" -dependencies = [ - "bstr", - "gix-config-value", - "gix-features", - "gix-glob", - "gix-path", - "gix-ref", - "gix-sec", - "log", - "memchr", - "nom", - "once_cell", - "smallvec", - "thiserror", - "unicode-bom", -] - -[[package]] -name = "gix-config-value" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e874f41437441c02991dcea76990b9058fadfc54b02ab4dd06ab2218af43897" -dependencies = [ - "bitflags 2.4.0", - "bstr", - "gix-path", - "libc", - "thiserror", -] - -[[package]] -name = "gix-credentials" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4874a4fc11ffa844a3c2b87a66957bda30a73b577ef1acf15ac34df5745de5ff" -dependencies = [ - "bstr", - "gix-command", - "gix-config-value", - "gix-path", - "gix-prompt", - "gix-sec", - "gix-url", - "thiserror", -] - -[[package]] -name = "gix-date" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc164145670e9130a60a21670d9b6f0f4f8de04e5dd256c51fa5a0340c625902" -dependencies = [ - "bstr", - "itoa", - "thiserror", - "time", -] - -[[package]] -name = "gix-diff" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644a0f2768bc42d7a69289ada80c9e15c589caefc6a315d2307202df83ed1186" -dependencies = [ - "gix-hash", - "gix-object", - "imara-diff", - "thiserror", -] - -[[package]] -name = "gix-discover" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a6b61363e63e7cdaa3e6f96acb0257ebdb3d8883e21eba5930c99f07f0a5fc0" -dependencies = [ - "bstr", - "dunce", - "gix-hash", - "gix-path", - "gix-ref", - "gix-sec", - "thiserror", -] - -[[package]] -name = "gix-features" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf69b0f5c701cc3ae22d3204b671907668f6437ca88862d355eaf9bc47a4f897" -dependencies = [ - "bytes", - "crc32fast", - "crossbeam-channel", - "flate2", - "gix-hash", - "libc", - "once_cell", - "parking_lot", - "prodash", - "sha1_smol", - "thiserror", - "walkdir", -] - -[[package]] -name = "gix-fs" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b37a1832f691fdc09910bd267f9a2e413737c1f9ec68c6e31f9e802616278a9" -dependencies = [ - "gix-features", -] - -[[package]] -name = "gix-glob" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c07c98204529ac3f24b34754540a852593d2a4c7349008df389240266627a72a" -dependencies = [ - "bitflags 2.4.0", - "bstr", - "gix-features", - "gix-path", -] - -[[package]] -name = "gix-hash" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b422ff2ad9a0628baaad6da468cf05385bf3f5ab495ad5a33cce99b9f41092f" -dependencies = [ - "hex", - "thiserror", -] - -[[package]] -name = "gix-hashtable" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385f4ce6ecf3692d313ca3aa9bd3b3d8490de53368d6d94bedff3af8b6d9c58d" -dependencies = [ - "gix-hash", - "hashbrown 0.14.0", - "parking_lot", -] - -[[package]] -name = "gix-ignore" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba205b6df563e2906768bb22834c82eb46c5fdfcd86ba2c347270bc8309a05b2" -dependencies = [ - "bstr", - "gix-glob", - "gix-path", - "unicode-bom", -] - -[[package]] -name = "gix-index" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f39c1ccc8f1912cbbd5191efc28dbc5f0d0598042aa56bc09427b7c34efab3ba" -dependencies = [ - "bitflags 2.4.0", - "bstr", - "btoi", - "filetime", - "gix-bitmap", - "gix-features", - "gix-hash", - "gix-lock", - "gix-object", - "gix-traverse", - "itoa", - "memmap2", - "smallvec", - "thiserror", -] - -[[package]] -name = "gix-lock" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c693d7f05730fa74a7c467150adc7cea393518410c65f0672f80226b8111555" -dependencies = [ - "gix-tempfile", - "gix-utils", - "thiserror", -] - -[[package]] -name = "gix-mailmap" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8856cec3bdc3610c06970d28b6cb20a0c6621621cf9a8ec48cbd23f2630f362" -dependencies = [ - "bstr", - "gix-actor", - "thiserror", -] - -[[package]] -name = "gix-object" -version = "0.29.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d96bd620fd08accdd37f70b2183cfa0b001b4f1c6ade8b7f6e15cb3d9e261ce" -dependencies = [ - "bstr", - "btoi", - "gix-actor", - "gix-features", - "gix-hash", - "gix-validate", - "hex", - "itoa", - "nom", - "smallvec", - "thiserror", -] - -[[package]] -name = "gix-odb" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2f324aa67672b6d0f2c0fa93f96eb6a7029d260e4c1df5dce3c015f5e5add" -dependencies = [ - "arc-swap", - "gix-features", - "gix-hash", - "gix-object", - "gix-pack", - "gix-path", - "gix-quote", - "parking_lot", - "tempfile", - "thiserror", -] - -[[package]] -name = "gix-pack" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164a515900a83257ae4aa80e741655bee7a2e39113fb535d7a5ac623b445ff20" -dependencies = [ - "clru", - "gix-chunk", - "gix-diff", - "gix-features", - "gix-hash", - "gix-hashtable", - "gix-object", - "gix-path", - "gix-tempfile", - "gix-traverse", - "memmap2", - "parking_lot", - "smallvec", - "thiserror", -] - -[[package]] -name = "gix-packetline" -version = "0.16.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a374cb5eba089e3c123df4d996eb00da411bb90ec92cb35bffeeb2d22ee106a" -dependencies = [ - "bstr", - "faster-hex", - "thiserror", -] - -[[package]] -name = "gix-path" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18609c8cbec8508ea97c64938c33cd305b75dfc04a78d0c3b78b8b3fd618a77c" -dependencies = [ - "bstr", - "gix-trace", - "home", - "once_cell", - "thiserror", -] - -[[package]] -name = "gix-prompt" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c22decaf4a063ccae2b2108820c8630c01bd6756656df3fe464b32b8958a5ea" -dependencies = [ - "gix-command", - "gix-config-value", - "parking_lot", - "rustix 0.38.11", - "thiserror", -] - -[[package]] -name = "gix-protocol" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877e49417f1730f4dbc2f7d9a2ab0f8b2f49ef08f97270691403ecde3d961e3a" -dependencies = [ - "bstr", - "btoi", - "gix-credentials", - "gix-features", - "gix-hash", - "gix-transport", - "maybe-async", - "nom", - "thiserror", -] - -[[package]] -name = "gix-quote" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475c86a97dd0127ba4465fbb239abac9ea10e68301470c9791a6dd5351cdc905" -dependencies = [ - "bstr", - "btoi", - "thiserror", -] - -[[package]] -name = "gix-ref" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e03989e9d49954368e1b526578230fc7189d1634acdfbe79e9ba1de717e15d5" -dependencies = [ - "gix-actor", - "gix-features", - "gix-fs", - "gix-hash", - "gix-lock", - "gix-object", - "gix-path", - "gix-tempfile", - "gix-validate", - "memmap2", - "nom", - "thiserror", -] - -[[package]] -name = "gix-refspec" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6ea733820df67e4cd7797deb12727905824d8f5b7c59d943c456d314475892" -dependencies = [ - "bstr", - "gix-hash", - "gix-revision", - "gix-validate", - "smallvec", - "thiserror", -] - -[[package]] -name = "gix-revision" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "810f35e9afeccca999d5d348b239f9c162353127d2e13ff3240e31b919e35476" -dependencies = [ - "bstr", - "gix-date", - "gix-hash", - "gix-hashtable", - "gix-object", - "thiserror", -] - -[[package]] -name = "gix-sec" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9615cbd6b456898aeb942cd75e5810c382fbfc48dbbff2fa23ebd2d33dcbe9c7" -dependencies = [ - "bitflags 2.4.0", - "gix-path", - "libc", - "windows", -] - -[[package]] -name = "gix-tempfile" -version = "5.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71a0d32f34e71e86586124225caefd78dabc605d0486de580d717653addf182" -dependencies = [ - "gix-fs", - "libc", - "once_cell", - "parking_lot", - "signal-hook", - "signal-hook-registry", - "tempfile", -] - -[[package]] -name = "gix-trace" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" - -[[package]] -name = "gix-transport" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f01c2bf7b989c679695ef635fc7d9e80072e08101be4b53193c8e8b649900102" -dependencies = [ - "base64 0.21.3", - "bstr", - "curl", - "gix-command", - "gix-credentials", - "gix-features", - "gix-packetline", - "gix-quote", - "gix-sec", - "gix-url", - "thiserror", -] - -[[package]] -name = "gix-traverse" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5be1e807f288c33bb005075111886cceb43ed8a167b3182a0f62c186e2a0dd1" -dependencies = [ - "gix-hash", - "gix-hashtable", - "gix-object", - "thiserror", -] - -[[package]] -name = "gix-url" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc77f89054297cc81491e31f1bab4027e554b5ef742a44bd7035db9a0f78b76" -dependencies = [ - "bstr", - "gix-features", - "gix-path", - "home", - "thiserror", - "url", -] - -[[package]] -name = "gix-utils" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" -dependencies = [ - "fastrand", -] - -[[package]] -name = "gix-validate" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba9b3737b2cef3dcd014633485f0034b0f1a931ee54aeb7d8f87f177f3c89040" -dependencies = [ - "bstr", - "thiserror", -] - -[[package]] -name = "gix-worktree" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69eaff0ae973a9d37c40f02ae5ae50fa726c8fc2fd3ab79d0a19eb61975aafa" -dependencies = [ - "bstr", - "filetime", - "gix-attributes", - "gix-features", - "gix-fs", - "gix-glob", - "gix-hash", - "gix-ignore", - "gix-index", - "gix-object", - "gix-path", - "io-close", - "thiserror", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "globset" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" -dependencies = [ - "aho-corasick", - "bstr", - "fnv", - "log", - "regex", -] - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] - -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hkdf" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" -dependencies = [ - "hmac", -] - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys 0.48.0", -] - -[[package]] -name = "http-auth" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5430cacd7a1f9a02fbeb350dfc81a0e5ed42d81f3398cb0ba184017f85bdcfbc" -dependencies = [ - "memchr", -] - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "if_chain" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" - -[[package]] -name = "ignore" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" -dependencies = [ - "globset", - "lazy_static", - "log", - "memchr", - "regex", - "same-file", - "thread_local", - "walkdir", - "winapi-util", -] - -[[package]] -name = "im-rc" -version = "15.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1955a75fa080c677d3972822ec4bad316169ab1cfc6c257a942c2265dbe5fe" -dependencies = [ - "bitmaps", - "rand_core", - "rand_xoshiro", - "sized-chunks", - "typenum", - "version_check", -] - -[[package]] -name = "imara-diff" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8" -dependencies = [ - "ahash 0.8.3", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", -] - -[[package]] -name = "io-close" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cadcf447f06744f8ce713d2d6239bb5bde2c357a452397a9ed90c625da390bc" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix 0.38.11", - "windows-sys 0.48.0", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" - -[[package]] -name = "jobserver" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" -dependencies = [ - "libc", -] - -[[package]] -name = "js-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json5" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" -dependencies = [ - "pest", - "pest_derive", - "serde", -] - -[[package]] -name = "kstring" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" -dependencies = [ - "static_assertions", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" - -[[package]] -name = "libgit2-sys" -version = "0.15.2+1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a80df2e11fb4a61f4ba2ab42dbe7f74468da143f1a75c74e11dee7c813f694fa" -dependencies = [ - "cc", - "libc", - "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -] - -[[package]] -name = "libnghttp2-sys" -version = "0.1.8+1.55.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fae956c192dadcdb5dace96db71fa0b827333cce7c7b38dc71446f024d8a340" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "libssh2-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "libz-sys" -version = "1.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" - -[[package]] -name = "lock_api" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "maybe-async" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1b8c13cb1f814b634a96b2c725449fe7ed464a7b8781de8688be5ffbd3f305" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "memchr" -version = "2.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" - -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "miow" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ffbca2f655e33c08be35d87278e5b18b89550a37dbd598c20db92f6a471123" -dependencies = [ - "windows-sys 0.42.0", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "num-traits" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "opener" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "293c15678e37254c15bd2f092314abb4e51d7fdde05c2021279c12631b54f005" -dependencies = [ - "bstr", - "winapi", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "ordered-float" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" -dependencies = [ - "num-traits", -] - -[[package]] -name = "ordered-multimap" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" -dependencies = [ - "dlv-list", - "hashbrown 0.12.3", -] - -[[package]] -name = "orion" -version = "0.17.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11468cc6afd61a126fe3f91cc4cc8a0dbe7917d0a4b5e8357ba91cc47444462" -dependencies = [ - "fiat-crypto", - "subtle", - "zeroize", -] - -[[package]] -name = "os_info" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006e42d5b888366f1880eda20371fedde764ed2213dc8496f49622fa0c99cd5e" -dependencies = [ - "log", - "serde", - "winapi", -] - -[[package]] -name = "p384" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.3.5", - "smallvec", - "windows-targets", -] - -[[package]] -name = "pasetors" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba765699a309908d55950919a3445e9491453e89b2587b1b2abe4143a48894c0" -dependencies = [ - "ct-codecs", - "ed25519-compact", - "getrandom", - "orion", - "p384", - "rand_core", - "regex", - "serde", - "serde_json", - "sha2", - "subtle", - "time", - "zeroize", -] - -[[package]] -name = "pathdiff" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "pest" -version = "2.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.31", -] - -[[package]] -name = "pest_meta" -version = "2.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" -dependencies = [ - "once_cell", - "pest", - "sha2", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "primeorder" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2fcef82c0ec6eefcc179b978446c399b3cdf73c392c35604e399eee6df1ee3" -dependencies = [ - "elliptic-curve", -] - -[[package]] -name = "proc-macro2" -version = "1.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "prodash" -version = "23.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9516b775656bc3e8985e19cd4b8c0c0de045095074e453d2c0a513b5f978392d" -dependencies = [ - "parking_lot", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_xoshiro" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" -dependencies = [ - "rand_core", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom", - "redox_syscall 0.2.16", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac", - "subtle", -] - -[[package]] -name = "ron" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88073939a61e5b7680558e6be56b419e208420c2adb92be54921fa6b72283f1a" -dependencies = [ - "base64 0.13.1", - "bitflags 1.3.2", - "serde", -] - -[[package]] -name = "rust-embed" -version = "6.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a36224c3276f8c4ebc8c20f158eca7ca4359c8db89991c4925132aaaf6702661" -dependencies = [ - "rust-embed-impl", - "rust-embed-utils", - "walkdir", -] - -[[package]] -name = "rust-embed-impl" -version = "6.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b94b81e5b2c284684141a2fb9e2a31be90638caf040bf9afbc5a0416afe1ac" -dependencies = [ - "proc-macro2", - "quote", - "rust-embed-utils", - "syn 2.0.31", - "walkdir", -] - -[[package]] -name = "rust-embed-utils" -version = "7.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d38ff6bf570dc3bb7100fce9f7b60c33fa71d80e88da3f2580df4ff2bdded74" -dependencies = [ - "globset", - "sha2", - "walkdir", -] - -[[package]] -name = "rust-ini" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" -dependencies = [ - "cfg-if", - "ordered-multimap", -] - -[[package]] -name = "rustfix" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd2853d9e26988467753bd9912c3a126f642d05d229a4b53f5752ee36c56481" -dependencies = [ - "anyhow", - "log", - "serde", - "serde_json", -] - -[[package]] -name = "rustix" -version = "0.37.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" -dependencies = [ - "bitflags 2.4.0", - "errno", - "libc", - "linux-raw-sys 0.4.5", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - -[[package]] -name = "ryu" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "schannel" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" -dependencies = [ - "windows-sys 0.48.0", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "scout-audit-internal" -version = "0.2.1" -dependencies = [ - "strum", -] - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", -] - -[[package]] -name = "sedregex" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19411e23596093f03bbd11dc45603b6329bb4bfec77b9fd13e2b9fc9b02efe3e" -dependencies = [ - "regex", -] - -[[package]] -name = "semver" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.188" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-value" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" -dependencies = [ - "ordered-float", - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.188" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", -] - -[[package]] -name = "serde_ignored" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80c31d5c53fd39f208e770f5a20a0bb214dee2a8d0d8adba18e19ad95a482ca5" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_json" -version = "1.0.105" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" -dependencies = [ - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - -[[package]] -name = "sha2" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "shell-escape" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" - -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" -dependencies = [ - "digest", - "rand_core", -] - -[[package]] -name = "sized-chunks" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" -dependencies = [ - "bitmaps", - "typenum", -] - -[[package]] -name = "smallvec" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" - -[[package]] -name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "spki" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strip-ansi-escapes" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "011cbb39cf7c1f62871aea3cc46e5817b0937b49e9447370c93cacbe93a766d8" -dependencies = [ - "vte", -] - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.31", -] - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tar" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" -dependencies = [ - "filetime", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix 0.38.11", - "windows-sys 0.48.0", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "terminal_size" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" -dependencies = [ - "rustix 0.37.23", - "windows-sys 0.48.0", -] - -[[package]] -name = "thiserror" -version = "1.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", -] - -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" -dependencies = [ - "deranged", - "itoa", - "libc", - "num_threads", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" - -[[package]] -name = "time-macros" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" -dependencies = [ - "time-core", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "toml" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0a3ab2091e52d7299a39d098e200114a972df0a7724add02a273aa9aada592" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.0.0", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" - -[[package]] -name = "unicode-bidi" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - -[[package]] -name = "unicode-bom" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98e90c70c9f0d4d1ee6d0a7d04aa06cb9bbd53d8cfbdd62a0269a7c2eb640552" - -[[package]] -name = "unicode-ident" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "url" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "vte" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983" -dependencies = [ - "arrayvec", - "utf8parse", - "vte_generate_state_changes", -] - -[[package]] -name = "vte_generate_state_changes" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "walkdir" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.31", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.31", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "winnow" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" -dependencies = [ - "memchr", -] - -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - -[[package]] -name = "zeroize" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" diff --git a/apps/cargo-scout-audit/Cargo.toml b/apps/cargo-scout-audit/Cargo.toml deleted file mode 100644 index 2f203142..00000000 --- a/apps/cargo-scout-audit/Cargo.toml +++ /dev/null @@ -1,48 +0,0 @@ -[package] -name = "cargo-scout-audit" -version = "0.2.1" -edition = "2021" -authors = [ - "Agustin Aon ", - "Arturo Beccar-Varela ", - "José García Crosta ", - "Facundo Lerena ", - "Agustin Losiggio ", - "Federico Pinho ", - "Ariel Waissbein Self { - Self { - cargo_config, - detectors_configs, - metadata, - verbose, - } - } - - /// Builds detectors and returns the paths to the built libraries - pub fn build(self, used_detectors: Vec) -> Result> { - let detectors_paths = self - .detectors_configs - .iter() - .map(|detectors_config| { - self.build_detectors(detectors_config.clone(), used_detectors.clone()) - }) - .flatten_ok() - .collect::>>()?; - - Ok(detectors_paths) - } - - pub fn get_detector_names(&self) -> Result> { - let detectors_names = self - .detectors_configs - .iter() - .map(|detectors_config| { - let builder = DetectorBuilder::new( - &self.cargo_config, - detectors_config.clone(), - self.metadata.clone(), - self.verbose, - ); - builder.get_detector_names() - }) - .flatten_ok() - .collect::>>()?; - - Ok(detectors_names) - } - - fn build_detectors( - &self, - detectors_config: DetectorConfiguration, - used_detectors: Vec, - ) -> Result> { - let builder = DetectorBuilder::new( - &self.cargo_config, - detectors_config, - self.metadata.clone(), - self.verbose, - ); - builder.build(used_detectors) - } -} diff --git a/apps/cargo-scout-audit/src/detectors/builder.rs b/apps/cargo-scout-audit/src/detectors/builder.rs deleted file mode 100644 index fcb4b755..00000000 --- a/apps/cargo-scout-audit/src/detectors/builder.rs +++ /dev/null @@ -1,161 +0,0 @@ -use std::path::PathBuf; - -use anyhow::{bail, ensure, Context, Ok, Result}; -use cargo::Config; -use cargo_metadata::Metadata; -use itertools::Itertools; - -use super::{configuration::DetectorConfiguration, library::Library, source::download_git_repo}; -use crate::utils::{cargo_package, rustup}; - -pub struct DetectorBuilder<'a> { - cargo_config: &'a Config, - detectors_config: DetectorConfiguration, - root_metadata: Metadata, - verbose: bool, -} - -impl<'a> DetectorBuilder<'a> { - /// Creates a new instance of `DetectorsBuilder`. - pub fn new( - cargo_config: &'a Config, - detectors_config: DetectorConfiguration, - root_metadata: Metadata, - verbose: bool, - ) -> Self { - Self { - cargo_config, - detectors_config, - root_metadata, - verbose, - } - } - - /// Compiles detector library and returns its path. - pub fn build(self, used_detectors: Vec) -> Result> { - let detector_root = self.download_detector()?; - let workspace_path = self.parse_library_path(&detector_root)?; - let library = self.get_library(workspace_path)?; - let library_paths = self.build_detectors(library)?; - let filtered_paths = self.filter_detectors(library_paths, used_detectors)?; - - Ok(filtered_paths) - } - - /// Returns list of detector names. - pub fn get_detector_names(self) -> Result> { - let detector_root = self.download_detector()?; - let workspace_path = self.parse_library_path(&detector_root)?; - let library = self.get_library(workspace_path)?; - let detector_names = library - .metadata - .packages - .into_iter() - .map(|p| p.name) - .collect_vec(); - Ok(detector_names) - } - - /// Downloads and returns detector root from supported sources. - fn download_detector(&self) -> Result { - if self.detectors_config.dependency.source_id().is_git() { - download_git_repo(&self.detectors_config.dependency, self.cargo_config) - } else if self.detectors_config.dependency.source_id().is_path() { - if let Some(path) = self.detectors_config.dependency.source_id().local_path() { - Ok(path) - } else { - bail!( - "Path source should have a local path: {}", - self.detectors_config.dependency.source_id() - ) - } - } else { - bail!(format!( - "Unsupported source id: {}", - self.detectors_config.dependency.source_id() - )); - } - } - - /// Parse dependency root with given library path. - fn parse_library_path(&self, dependency_root: &PathBuf) -> Result { - let path = match &self.detectors_config.path { - Some(path) => dependency_root.join(path), - None => dependency_root.clone(), - }; - let path = dunce::canonicalize(&path) - .with_context(|| format!("Could not canonicalize {path:?}"))?; - let dependency_root = dunce::canonicalize(dependency_root) - .with_context(|| format!("Could not canonicalize {dependency_root:?}"))?; - ensure!( - path.starts_with(&dependency_root), - "Path could refer to `{}`, which is outside of `{}`", - path.to_string_lossy(), - dependency_root.to_string_lossy() - ); - Ok(path) - } - - /// Parse workspace path into library. - fn get_library(&self, workspace_path: PathBuf) -> Result { - // Dylint annotation - // smoelius: Collecting the package ids before building reveals missing/unparsable `Cargo.toml` - // files sooner. - - // smoelius: Why are we doing this complicated dance at all? Because we want to leverage Cargo's - // download cache. But we also want to support git repositories with libraries that use - // different compiler versions. And we have to work around the fact that "all projects within a - // workspace are intended to be built with the same version of the compiler" - // (https://github.com/rust-lang/rustup/issues/1399#issuecomment-383376082). - ensure!( - workspace_path.is_dir(), - "Not a directory: {}", - workspace_path.to_string_lossy() - ); - - let package_metadata = cargo_package::package_metadata(&workspace_path)?; - let toolchain = rustup::active_toolchain(&workspace_path)?; - let library = Library::new( - workspace_path, - toolchain, - self.root_metadata - .target_directory - .clone() - .into_std_path_buf(), - package_metadata, - ); - Ok(library) - } - - /// Builds detectors returning their compiled paths. - fn build_detectors(&self, library: Library) -> Result> { - let library_paths = library.build(self.verbose)?; - Ok(library_paths) - } - - fn filter_detectors( - &self, - detector_paths: Vec, - used_detectors: Vec, - ) -> Result> { - let mut filtered_paths = Vec::new(); - - for path in detector_paths { - let detector_name = path.file_name().unwrap().to_str().unwrap().to_string(); - - #[cfg(not(windows))] - let detector_name = detector_name.split("lib").collect::>()[1]; - - let detector_name = detector_name.split('@').collect::>()[0] - .to_string() - .replace('_', "-"); - if used_detectors.contains(&detector_name) { - filtered_paths.push(path) - } else { - std::fs::remove_file(path)?; - } - } - - Ok(filtered_paths) - } -} diff --git a/apps/cargo-scout-audit/src/detectors/configuration.rs b/apps/cargo-scout-audit/src/detectors/configuration.rs deleted file mode 100644 index 171c256d..00000000 --- a/apps/cargo-scout-audit/src/detectors/configuration.rs +++ /dev/null @@ -1,42 +0,0 @@ -use std::path::Path; - -use anyhow::Result; -use cargo::{ - core::{Dependency, GitReference, SourceId}, - util::IntoUrl, -}; - -#[derive(Debug, Clone)] -pub struct DetectorConfiguration { - pub dependency: Dependency, - pub path: Option, -} - -pub type DetectorsConfigurationList = Vec; - -/// Returns list of detectors. -pub fn get_detectors_configuration() -> Result { - let detectors = vec![DetectorConfiguration { - dependency: Dependency::parse( - "library", - None, - SourceId::for_git( - &"https://github.com/CoinFabrik/scout".into_url()?, - GitReference::DefaultBranch, - )?, - )?, - path: Some("detectors".into()), - }]; - - Ok(detectors) -} - -/// Returns local detectors configuration from custom path. -pub fn get_local_detectors_configuration(path: &Path) -> Result { - let detectors = vec![DetectorConfiguration { - dependency: Dependency::parse("library", None, SourceId::for_path(path)?)?, - path: None, - }]; - - Ok(detectors) -} diff --git a/apps/cargo-scout-audit/src/detectors/library.rs b/apps/cargo-scout-audit/src/detectors/library.rs deleted file mode 100644 index d8c5b546..00000000 --- a/apps/cargo-scout-audit/src/detectors/library.rs +++ /dev/null @@ -1,95 +0,0 @@ -use std::{env::consts, path::PathBuf}; - -use anyhow::Result; -use cargo_metadata::Metadata; -use itertools::Itertools; - -use crate::utils::{cargo, env}; - -/// Represents a Rust library. -#[derive(Debug, Clone)] -pub struct Library { - pub root: PathBuf, - pub toolchain: String, - pub target_dir: PathBuf, - pub metadata: Metadata, -} - -impl Library { - /// Creates a new instance of `Library`. - pub fn new(root: PathBuf, toolchain: String, target_dir: PathBuf, metadata: Metadata) -> Self { - Self { - root, - toolchain, - target_dir, - metadata, - } - } - - /// Builds the library and returns its path. - pub fn build(&self, verbose: bool) -> Result> { - // Build entire workspace - cargo::build("detectors", !verbose) - .sanitize_environment() - .env_remove(env::RUSTFLAGS) - .current_dir(&self.root) - .args(["--release"]) - .success()?; - - // Verify all libraries were built - let compiled_library_paths = self - .metadata - .packages - .clone() - .into_iter() - .map(|p| self.path(p.name)) - .collect_vec(); - - let unexistant_libraries = compiled_library_paths - .clone() - .into_iter() - .filter(|p| !p.exists()) - .collect_vec(); - if !unexistant_libraries.is_empty() { - anyhow::bail!("Could not determine if {:?} exist", unexistant_libraries); - } - - // Copy libraries to target directory - let target_dir = self.target_directory(); - if !target_dir.exists() { - std::fs::create_dir_all(&target_dir)?; - } - - let target_compiled_library_paths = compiled_library_paths - .into_iter() - .map(|p| { - let target_path = target_dir.join(p.file_name().unwrap()); - std::fs::copy(&p, &target_path)?; - Ok(target_path) - }) - .collect::>>()?; - - Ok(target_compiled_library_paths) - } - - pub fn target_directory(&self) -> PathBuf { - self.target_dir - .join("scout/libraries") - .join(&self.toolchain) - } - - pub fn path(&self, library_name: String) -> PathBuf { - self.metadata - .target_directory - .clone() - .into_std_path_buf() - .join("release") - .join(format!( - "{}{}@{}{}", - consts::DLL_PREFIX, - library_name.replace('-', "_"), - self.toolchain, - consts::DLL_SUFFIX - )) - } -} diff --git a/apps/cargo-scout-audit/src/detectors/source/git.rs b/apps/cargo-scout-audit/src/detectors/source/git.rs deleted file mode 100644 index c6892d80..00000000 --- a/apps/cargo-scout-audit/src/detectors/source/git.rs +++ /dev/null @@ -1,64 +0,0 @@ -use std::path::PathBuf; - -use anyhow::{anyhow, bail, ensure, Result}; -use cargo::{ - core::{source::MaybePackage, Dependency, Package, PackageId, QueryKind, Source}, - Config, -}; - -/// Downloads git repo using cargo native cache and returns its path. -pub fn download_git_repo(dependency: &Dependency, config: &Config) -> Result { - let _lock = config.acquire_package_cache_lock()?; - let mut source = dependency.source_id().load(config, &Default::default())?; - let package_id = sample_package_id(dependency, &mut *source)?; - - if let MaybePackage::Ready(package) = source.download(package_id)? { - git_dependency_root_from_package(config, &*source, &package) - } else { - bail!(format!("`{}` is not ready", package_id.name())) - } -} - -fn sample_package_id(dep: &Dependency, source: &mut dyn Source) -> anyhow::Result { - let mut package_id: Option = None; - - while { - let poll = source.query(dep, QueryKind::Fuzzy, &mut |summary| { - if package_id.is_none() { - package_id = Some(summary.package_id()); - } - })?; - if poll.is_pending() { - source.block_until_ready()?; - package_id.is_none() - } else { - false - } - } {} - - package_id.ok_or_else(|| anyhow!("Found no packages in `{}`", dep.source_id())) -} - -fn git_dependency_root_from_package<'a>( - config: &'a Config, - source: &(dyn Source + 'a), - package: &Package, -) -> anyhow::Result { - let package_root = package.root(); - - if source.source_id().is_git() { - let git_path = config.git_path(); - let git_path = config.assert_package_cache_locked(&git_path); - ensure!( - package_root.starts_with(git_path.join("checkouts")), - "Unexpected path: {}", - package_root.to_string_lossy() - ); - let n = git_path.components().count() + 3; - Ok(package_root.components().take(n).collect()) - } else if source.source_id().is_path() { - unreachable!() - } else { - unimplemented!() - } -} diff --git a/apps/cargo-scout-audit/src/detectors/source/mod.rs b/apps/cargo-scout-audit/src/detectors/source/mod.rs deleted file mode 100644 index c6709e47..00000000 --- a/apps/cargo-scout-audit/src/detectors/source/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod git; - -pub use git::download_git_repo; diff --git a/apps/cargo-scout-audit/src/lib.rs b/apps/cargo-scout-audit/src/lib.rs deleted file mode 100644 index 55e0bf7f..00000000 --- a/apps/cargo-scout-audit/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod detectors; -pub mod startup; -pub mod utils; diff --git a/apps/cargo-scout-audit/src/main.rs b/apps/cargo-scout-audit/src/main.rs deleted file mode 100644 index 3f2652a3..00000000 --- a/apps/cargo-scout-audit/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -use cargo_scout_audit::startup::{run_scout, CargoSubCommand, Cli}; -use clap::Parser; - -fn main() { - env_logger::init(); - - let cli = Cli::parse(); - match cli.subcmd { - CargoSubCommand::ScoutAudit(opts) => run_scout(opts).unwrap(), - } -} diff --git a/apps/cargo-scout-audit/src/startup.rs b/apps/cargo-scout-audit/src/startup.rs deleted file mode 100644 index ac1a4ae8..00000000 --- a/apps/cargo-scout-audit/src/startup.rs +++ /dev/null @@ -1,260 +0,0 @@ -use core::panic; -use std::{fs, path::PathBuf}; - -use anyhow::{bail, Context, Result}; -use cargo::Config; -use cargo_metadata::MetadataCommand; -use clap::{Parser, Subcommand, ValueEnum}; -use dylint::Dylint; - -use crate::{ - detectors::{get_detectors_configuration, get_local_detectors_configuration, Detectors}, - utils::{ - detectors::{get_excluded_detectors, get_filtered_detectors, list_detectors}, - output::{format_into_html, format_into_json, format_into_sarif}, - }, -}; - -#[derive(Debug, Parser)] -#[clap(display_name = "cargo")] -pub struct Cli { - #[clap(subcommand)] - pub subcmd: CargoSubCommand, -} - -#[derive(Debug, Subcommand)] -pub enum CargoSubCommand { - ScoutAudit(Scout), -} -#[derive(Debug, Default, Clone, ValueEnum, PartialEq)] -pub enum OutputFormat { - #[default] - Text, - Json, - Html, - Sarif, -} - -#[derive(Clone, Debug, Default, Parser)] -#[command(author, version, about, long_about = None)] -pub struct Scout { - #[clap(short, long, value_name = "path", help = "Path to Cargo.toml.")] - pub manifest_path: Option, - - // Exlude detectors - #[clap( - short, - long, - value_name = "detector/s", - help = "Exclude the given detectors, separated by commas." - )] - pub exclude: Option, - - // Filter by detectors - #[clap( - short, - long, - value_name = "detector/s", - help = "Filter by the given detectors, separated by commas." - )] - pub filter: Option, - - // List all the available detectors - #[clap(short, long, help = "List all the available detectors")] - pub list_detectors: bool, - - #[clap(last = true, help = "Arguments for `cargo check`.")] - pub args: Vec, - - #[clap( - short, - long, - value_name = "type", - help = "Sets the output type", - default_value = "text" - )] - pub output_format: OutputFormat, - - #[clap(long, value_name = "path", help = "Path to the output file.")] - pub output_path: Option, - - #[clap(long, value_name = "path", help = "Path to detectors workspace.")] - pub local_detectors: Option, - - #[clap( - short, - long, - help = "Prints verbose information.", - default_value_t = false - )] - pub verbose: bool, -} - -pub fn run_scout(opts: Scout) -> Result<()> { - // Validations - if opts.filter.is_some() && opts.exclude.is_some() { - panic!("You can't use `--exclude` and `--filter` at the same time."); - } - - if let Some(path) = &opts.output_path { - if path.is_dir() { - bail!("The output path can't be a directory."); - } - } - - // Prepare configurations - let mut metadata = MetadataCommand::new(); - if let Some(manifest_path) = &opts.manifest_path { - metadata.manifest_path(manifest_path); - } - let metadata = metadata.exec().context("Failed to get metadata")?; - - let cargo_config = Config::default().context("Failed to get config")?; - cargo_config.shell().set_verbosity(if opts.verbose { - cargo::core::Verbosity::Verbose - } else { - cargo::core::Verbosity::Quiet - }); - let detectors_config = match &opts.local_detectors { - Some(path) => get_local_detectors_configuration(&PathBuf::from(path)) - .context("Failed to get local detectors configuration")?, - None => get_detectors_configuration().context("Failed to get detectors configuration")?, - }; - - // Misc configurations - // If there is a need to exclude or filter by detector, the dylint tool needs to be recompiled. - // TODO: improve detector system so that doing this isn't necessary. - if opts.exclude.is_some() || opts.filter.is_some() { - remove_target_dylint(&opts.manifest_path)?; - } - - // Instantiate detectors - let detectors = Detectors::new(cargo_config, detectors_config, metadata, opts.verbose); - let detectors_names = detectors - .get_detector_names() - .context("Failed to build detectors")?; - - if opts.list_detectors { - list_detectors(detectors_names); - return Ok(()); - } - - let used_detectors = if let Some(filter) = &opts.filter { - get_filtered_detectors(filter.to_string(), detectors_names)? - } else if let Some(excluded) = &opts.exclude { - get_excluded_detectors(excluded.to_string(), detectors_names)? - } else { - detectors_names - }; - - let detectors_paths = detectors - .build(used_detectors) - .context("Failed to build detectors")?; - - // Run dylint - run_dylint(detectors_paths, opts).context("Failed to run dylint")?; - - Ok(()) -} - -fn run_dylint(detectors_paths: Vec, opts: Scout) -> Result<()> { - // Convert detectors paths to string - let detectors_paths: Vec = detectors_paths - .iter() - .map(|path| path.to_string_lossy().to_string()) - .collect(); - - // Initialize options - let stderr_temp_file = tempfile::NamedTempFile::new()?; - let stdout_temp_file = tempfile::NamedTempFile::new()?; - - let is_output_stdout = opts.output_format == OutputFormat::Text && opts.output_path.is_none(); - - let pipe_stdout = Some(stdout_temp_file.path().to_string_lossy().to_string()); - let pipe_stderr = if is_output_stdout { - None - } else { - Some(stderr_temp_file.path().to_string_lossy().to_string()) - }; - - let options = Dylint { - paths: detectors_paths, - args: opts.args, - manifest_path: opts.manifest_path.map(|p| p.to_string_lossy().to_string()), - pipe_stdout, - pipe_stderr, - quiet: !opts.verbose, - ..Default::default() - }; - - dylint::run(&options)?; - - // Format output and write to file (if necessary) - if is_output_stdout { - return Ok(()); - } - - let mut stderr_file = fs::File::open(stderr_temp_file.path())?; - let stdout_file = fs::File::open(stdout_temp_file.path())?; - - match opts.output_format { - OutputFormat::Json => { - let mut json_file = match &opts.output_path { - Some(path) => fs::File::create(path)?, - None => fs::File::create("report.json")?, - }; - std::io::Write::write_all( - &mut json_file, - format_into_json(stderr_file, stdout_file)?.as_bytes(), - )?; - } - OutputFormat::Html => { - let mut html_file = match &opts.output_path { - Some(path) => fs::File::create(path)?, - None => fs::File::create("report.html")?, - }; - std::io::Write::write_all( - &mut html_file, - format_into_html(stderr_file, stdout_file)?.as_bytes(), - )?; - } - OutputFormat::Text => { - // If the output path is not set, dylint prints the report to stdout - if let Some(output_file) = opts.output_path { - let mut txt_file = fs::File::create(output_file)?; - std::io::copy(&mut stderr_file, &mut txt_file)?; - } - } - OutputFormat::Sarif => { - let mut sarif_file = match &opts.output_path { - Some(path) => fs::File::create(path)?, - None => fs::File::create("report.sarif")?, - }; - std::io::Write::write_all( - &mut sarif_file, - format_into_sarif(stderr_file, stdout_file)?.as_bytes(), - )?; - } - } - - stderr_temp_file.close()?; - stdout_temp_file.close()?; - - Ok(()) -} - -fn remove_target_dylint(manifest_path: &Option) -> Result<()> { - let target_dylint_path = match manifest_path { - Some(manifest_path) => { - let manifest_path_parent = manifest_path - .parent() - .context("Error getting manifest path parent")?; - manifest_path_parent.join("target").join("dylint") - } - None => std::env::current_dir()?.join("target").join("dylint"), - }; - if target_dylint_path.exists() { - fs::remove_dir_all(target_dylint_path)?; - } - Ok(()) -} diff --git a/apps/cargo-scout-audit/src/utils/cargo.rs b/apps/cargo-scout-audit/src/utils/cargo.rs deleted file mode 100644 index 9f78a6e6..00000000 --- a/apps/cargo-scout-audit/src/utils/cargo.rs +++ /dev/null @@ -1,51 +0,0 @@ -#[cfg(windows)] -use std::path::Path; -use std::{ - io::{IsTerminal, Write}, - process::Stdio, -}; - -use ansi_term::Style; - -use super::command::Command; - -#[must_use] -pub fn build(description: &str, quiet: bool) -> Command { - cargo("build", "Building", description, quiet) -} -fn cargo(subcommand: &str, verb: &str, description: &str, quiet: bool) -> Command { - if !quiet { - // smoelius: Writing directly to `stderr` avoids capture by `libtest`. - let message = format!("{verb} {description}"); - std::io::stderr() - .write_fmt(format_args!( - "{}\n", - if std::io::stdout().is_terminal() { - Style::new().bold() - } else { - Style::new() - } - .paint(message) - )) - .expect("Could not write to stderr"); - } - let mut command = Command::new("cargo"); - #[cfg(windows)] - { - // Dylint annotation - // smoelius: Work around: https://github.com/rust-lang/rustup/pull/2978 - let cargo_home = home::cargo_home().unwrap(); - let old_path = std::env::var("PATH").unwrap(); - let new_path = std::env::join_paths( - std::iter::once(Path::new(&cargo_home).join("bin")) - .chain(std::env::split_paths(&old_path)), - ) - .unwrap(); - command.envs(vec![("PATH", new_path)]); - } - command.args([subcommand]); - if quiet { - command.stderr(Stdio::null()); - } - command -} diff --git a/apps/cargo-scout-audit/src/utils/cargo_package.rs b/apps/cargo-scout-audit/src/utils/cargo_package.rs deleted file mode 100644 index fe631239..00000000 --- a/apps/cargo-scout-audit/src/utils/cargo_package.rs +++ /dev/null @@ -1,10 +0,0 @@ -use std::path::Path; - -use cargo_metadata::{Metadata, MetadataCommand}; - -pub fn package_metadata(package_root: &Path) -> Result { - MetadataCommand::new() - .current_dir(package_root) - .no_deps() - .exec() -} diff --git a/apps/cargo-scout-audit/src/utils/command.rs b/apps/cargo-scout-audit/src/utils/command.rs deleted file mode 100644 index 6421d871..00000000 --- a/apps/cargo-scout-audit/src/utils/command.rs +++ /dev/null @@ -1,129 +0,0 @@ -use std::{ - ffi::OsStr, - path::Path, - process::{Command as StdCommand, Output, Stdio}, -}; - -use anyhow::{ensure, Context, Result}; - -use super::env; - -pub struct Command { - command: StdCommand, -} - -impl Command { - pub fn new>(program: S) -> Self { - Self { - command: StdCommand::new(program), - } - } - - pub fn args(&mut self, args: I) -> &mut Self - where - I: IntoIterator, - S: AsRef, - { - self.command.args(args); - self - } - - #[allow(dead_code)] - pub fn envs(&mut self, vars: I) -> &mut Self - where - I: IntoIterator, - K: AsRef, - V: AsRef, - { - self.command.envs(vars); - self - } - - pub fn env_remove>(&mut self, key: K) -> &mut Self { - self.command.env_remove(key); - self - } - - pub fn current_dir>(&mut self, dir: P) -> &mut Self { - self.command.current_dir(dir); - self - } - - #[allow(dead_code)] - pub fn stdout>(&mut self, cfg: T) -> &mut Self { - self.command.stdout(cfg); - self - } - - pub fn stderr>(&mut self, cfg: T) -> &mut Self { - self.command.stderr(cfg); - self - } - - pub fn sanitize_environment(&mut self) -> &mut Self { - self.env_remove(env::RUSTC); - self.env_remove(env::RUSTUP_TOOLCHAIN); - self - } - - pub fn output(&mut self) -> Result { - log::debug!("{:?}", self.command.get_envs().collect::>()); - log::debug!("{:?}", self.command.get_current_dir()); - log::debug!("{:?}", self.command); - - let output = self - .command - .output() - .with_context(|| format!("Could not get output of `{:?}`", self.command))?; - - ensure!( - output.status.success(), - "command failed: {:?}\nstdout: {:?}\nstderr: {:?}", - self.command, - std::str::from_utf8(&output.stdout).unwrap_or_default(), - std::str::from_utf8(&output.stderr).unwrap_or_default() - ); - - Ok(output) - } - - pub fn success(&mut self) -> Result<()> { - log::debug!("{:?}", self.command.get_envs().collect::>()); - log::debug!("{:?}", self.command.get_current_dir()); - log::debug!("{:?}", self.command); - - let status = self - .command - .status() - .with_context(|| format!("Could not get status of `{:?}`", self.command))?; - - ensure!(status.success(), "command failed: {:?}", self.command); - - Ok(()) - } -} - -#[allow(unused_variables)] -#[allow(dead_code)] -pub fn driver(toolchain: &str, driver: &Path) -> Result { - #[allow(unused_mut)] - let mut command = Command::new(driver); - #[cfg(windows)] - { - // MinerSebas: To succesfully determine the dylint driver Version on Windows, - // it is neccesary to add some Libraries to the Path. - let rustup_home = std::env::var("RUSTUP_HOME")?; - let old_path = std::env::var("PATH")?; - let new_path = std::env::join_paths( - std::iter::once( - Path::new(&rustup_home) - .join("toolchains") - .join(toolchain) - .join("bin"), - ) - .chain(std::env::split_paths(&old_path)), - )?; - command.envs(vec![("PATH", new_path)]); - } - Ok(command) -} diff --git a/apps/cargo-scout-audit/src/utils/detectors.rs b/apps/cargo-scout-audit/src/utils/detectors.rs deleted file mode 100644 index df3be387..00000000 --- a/apps/cargo-scout-audit/src/utils/detectors.rs +++ /dev/null @@ -1,60 +0,0 @@ -use anyhow::bail; -use anyhow::Result; - -fn get_parsed_detectors(detectors: String) -> Vec { - detectors - .to_lowercase() - .trim() - .replace('_', "-") - .split(',') - .map(|detector| detector.trim().to_string()) - .collect::>() -} - -pub fn get_filtered_detectors(filter: String, detectors_names: Vec) -> Result> { - let mut used_detectors: Vec = Vec::new(); - let parsed_detectors = get_parsed_detectors(filter); - for detector in parsed_detectors { - if detectors_names.contains(&detector.to_string()) { - used_detectors.push(detector.to_string()); - } else { - bail!("The detector '{}' doesn't exist", detector); - } - } - Ok(used_detectors) -} - -pub fn get_excluded_detectors( - excluded: String, - detectors_names: Vec, -) -> Result> { - let mut used_detectors = detectors_names.clone(); - let parsed_detectors = get_parsed_detectors(excluded); - for detector in parsed_detectors { - if detectors_names.contains(&detector.to_string()) { - let index = used_detectors.iter().position(|x| x == &detector).unwrap(); - used_detectors.remove(index); - } else { - bail!("The detector '{}' doesn't exist", detector); - } - } - Ok(used_detectors) -} - -pub fn list_detectors(detectors_names: Vec) { - let separator = "─".repeat(48); - let upper_border = format!("┌{}┐", separator); - let lower_border = format!("└{}┘", separator); - let empty_line = format!("│{:48}│", ""); - - println!("{}", upper_border); - println!("│{:^47}│", "🔍 Available detectors:"); - println!("{}", empty_line); - - for (index, detector_name) in detectors_names.iter().enumerate() { - println!("│ {:>2}. {:<43}│", index + 1, detector_name); - } - - println!("{}", empty_line); - println!("{}", lower_border); -} diff --git a/apps/cargo-scout-audit/src/utils/env.rs b/apps/cargo-scout-audit/src/utils/env.rs deleted file mode 100644 index 06aa920f..00000000 --- a/apps/cargo-scout-audit/src/utils/env.rs +++ /dev/null @@ -1,31 +0,0 @@ -#![allow(dead_code)] - -macro_rules! declare_const { - ($var: ident) => { - pub const $var: &str = stringify!($var); - }; -} - -declare_const!(CARGO_HOME); -declare_const!(CARGO_MANIFEST_DIR); -declare_const!(CARGO_PKG_NAME); -declare_const!(CARGO_TARGET_DIR); -declare_const!(CARGO_TERM_COLOR); -declare_const!(CLIPPY_DISABLE_DOCS_LINKS); -declare_const!(CLIPPY_DRIVER_PATH); -declare_const!(DOCS_RS); -declare_const!(DYLINT_DRIVER_PATH); -declare_const!(DYLINT_LIBRARY_PATH); -declare_const!(DYLINT_LIBS); -declare_const!(DYLINT_LIST); -declare_const!(DYLINT_RUSTFLAGS); -declare_const!(DYLINT_TOML); -declare_const!(OUT_DIR); -declare_const!(PATH); -declare_const!(RUSTC); -declare_const!(RUSTC_WORKSPACE_WRAPPER); -declare_const!(RUSTFLAGS); -declare_const!(RUSTUP_HOME); -declare_const!(RUSTUP_TOOLCHAIN); -declare_const!(RUST_BACKTRACE); -declare_const!(TARGET); diff --git a/apps/cargo-scout-audit/src/utils/mod.rs b/apps/cargo-scout-audit/src/utils/mod.rs deleted file mode 100644 index 5fa76e9c..00000000 --- a/apps/cargo-scout-audit/src/utils/mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub mod cargo; -pub mod cargo_package; -pub mod command; -pub mod detectors; -pub mod env; -pub mod output; -pub mod rustup; diff --git a/apps/cargo-scout-audit/src/utils/output.rs b/apps/cargo-scout-audit/src/utils/output.rs deleted file mode 100644 index dfbb366e..00000000 --- a/apps/cargo-scout-audit/src/utils/output.rs +++ /dev/null @@ -1,201 +0,0 @@ -use std::collections::HashMap; -use std::fs::File; -use std::io::BufRead; -use std::vec; - -use anyhow::Context; -use regex::RegexBuilder; -use scout_audit_internal::{Detector, IntoEnumIterator}; -use serde_json::{json, Value}; - -pub fn format_into_json(scout_output: File, internals: File) -> anyhow::Result { - let json_errors = jsonify(scout_output, internals)?; - Ok(serde_json::to_string_pretty(&json_errors)?) -} - -fn jsonify(scout_output: File, internals: File) -> anyhow::Result { - let json_errors: serde_json::Value = get_errors_from_output(scout_output, internals)? - .iter() - .filter(|(_, (spans, _))| !spans.is_empty()) - .map(|(name, (spans, error))| { - ( - name, - json!({ - "error_msg": error, - "spans": spans - }), - ) - }) - .collect(); - - Ok(json_errors) -} - -fn get_errors_from_output( - mut scout_output: File, - mut scout_internals: File, -) -> anyhow::Result, String)>> { - let regex = RegexBuilder::new(r"warning:.*") - .multi_line(true) - .case_insensitive(true) - .build()?; - - let mut stderr_string = String::new(); - std::io::Read::read_to_string(&mut scout_output, &mut stderr_string)?; - - let mut scout_internals_spans: Vec = vec![]; - - for line in std::io::BufReader::new(&mut scout_internals).lines() { - let line = line?; - let span = line.split('@').collect::>()[1]; - scout_internals_spans.push(span.to_string()); - } - - let msg_to_name: HashMap = Detector::iter() - .map(|e| (e.get_lint_message().to_string(), e.to_string())) - .collect(); - - let mut errors: HashMap, String)> = Detector::iter() - .map(|e| (e.to_string(), (vec![], "".to_string()))) - .collect(); - - for (i, elem) in regex.find_iter(&stderr_string).enumerate() { - let parts = elem.as_str().split('\n').collect::>(); - - for err in Detector::iter().map(|e| e.get_lint_message()) { - if parts[0].contains(err) { - let name = msg_to_name.get(err).with_context(|| { - format!("Error making json: {} not found in the error map", err) - })?; - - if let Some((spans, error)) = errors.get_mut(name) { - spans.push(scout_internals_spans[i].to_string()); - *error = err.to_string(); - } - } - } - } - Ok(errors) -} - -pub fn format_into_html(scout_output: File, internals: File) -> anyhow::Result { - let json = jsonify(scout_output, internals)?; - let mut html = String::new(); - html.push_str( - r#" - - - - - - - - - - - - - "#, - ); - - for (key, value) in json.as_object().unwrap() { - let error_msg = value["error_msg"].as_str().unwrap(); - let spans = value["spans"].as_array().unwrap(); - let mut spans_html = String::new(); - for span in spans { - spans_html.push_str(&format!("
  • {}
  • ", span.as_str().unwrap())); - } - html.push_str(&format!( - r#" - - - - - - "#, - key, spans_html, error_msg - )); - } - - Ok(html) -} - -fn serify(scout_output: File, scout_internals: File) -> anyhow::Result { - let errors: HashMap, String)> = - get_errors_from_output(scout_output, scout_internals)?; - - let sarif_output = json!({ - "$schema": "https://json.schemastore.org/sarif-2.1.0", - "version": "2.1.0", - "runs": [ - { - "tool": { - "driver": { - "name": env!("CARGO_PKG_NAME"), - "version": env!("CARGO_PKG_VERSION"), - "rules": Detector::iter().filter(|e| { - errors.contains_key(&e.to_string()) && !errors.get(&e.to_string()).unwrap().0.is_empty() - }).map(|e| { - json!({ - "id": e.to_string(), - "shortDescription": { - "text": e.get_lint_message() - }}) - - }).collect::>(), - "informationUri": "https://coinfabrik.github.io/scout/", - } - }, - "results": build_sarif_results(&errors)?, - } - ] - }); - let json_errors = serde_json::to_value(sarif_output)?; - Ok(json_errors) -} - -pub fn format_into_sarif(scout_output: File, scout_internals: File) -> anyhow::Result { - Ok(serify(scout_output, scout_internals)?.to_string()) -} - -fn build_sarif_results( - errors: &HashMap, String)>, -) -> anyhow::Result> { - let runs: Vec = errors - .iter() - .flat_map(|(name, (spans, msg))| { - spans.iter().filter_map(move |span| { - let span: Result = serde_json::from_str(span); - if let Ok(span_value) = span { - Some(json!({ - "ruleId": name, - "level": "error", - "message": { - "text": msg - }, - "locations": [span_value], - })) - } else { - None - } - }) - }) - .collect(); - - Ok(runs) -} diff --git a/apps/cargo-scout-audit/src/utils/rustup.rs b/apps/cargo-scout-audit/src/utils/rustup.rs deleted file mode 100644 index 929a4089..00000000 --- a/apps/cargo-scout-audit/src/utils/rustup.rs +++ /dev/null @@ -1,23 +0,0 @@ -use std::path::Path; - -use anyhow::{anyhow, Result}; - -use super::command::Command; - -/// Returns `rustup` active toolchain -/// -/// Dylint annotation -/// smoelius: Consider carefully whether you need to call this function! In most cases, the toolchain -/// you want is not the one returned by rustup. -pub fn active_toolchain(path: &Path) -> Result { - let output = Command::new("rustup") - .sanitize_environment() - .current_dir(path) - .args(["show", "active-toolchain"]) - .output()?; - let stdout = std::str::from_utf8(&output.stdout)?; - stdout - .split_once(' ') - .map(|(s, _)| s.to_owned()) - .ok_or_else(|| anyhow!("Could not determine active toolchain")) -} diff --git a/apps/cargo-scout-audit/tests/README.md b/apps/cargo-scout-audit/tests/README.md deleted file mode 100644 index 272ce747..00000000 --- a/apps/cargo-scout-audit/tests/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Acceptance Criteria for Tests in Rust - -This document provides the acceptance criteria for writing and executing tests in Rust. The examples are drawn from the provided files: `test.rs` (which contains the logic to perform the tests) and `test-configuration.yaml` (which contains the paths and configurations for the tests). - -## Acceptance Criteria for Adding Examples and Ensuring Tests Work - -### 1. Valid YAML Structure - -The `test-configuration.yaml` file must be a valid YAML file that follows the specific structure of `detectors`. Each `detector` should have a unique name and include a `DetectorConfig` object. - -### 2. Warning Message - -Each `DetectorConfig` must include a `warning_message`. This message is expected to appear in the output when a test against a vulnerable path is executed. The `warning_message` should be specific and unique to the vulnerability that the detector is designed to identify. - -### 3. Examples - -Each `DetectorConfig` must also include at least one `Example` object. An `Example` consists of a `vulnerable_path` and a `remediated_path`. - -### 4. Path Specification - -The `vulnerable_path` and `remediated_path` in each `Example` must point to valid `Cargo.toml` files in the project. These paths are relative to the directory where the tests are executed from. - -- `vulnerable_path`: This is the path to the project file of the code that is expected to contain the vulnerability. -- `remediated_path`: This is the path to the project file of the code that has been remediated and is expected to be free of the vulnerability. - -### 5. Path Validation - -All paths specified in the `vulnerable_path` and `remediated_path` must be valid and the referenced `Cargo.toml` files should exist. If a path is invalid or the referenced file does not exist, the test will fail. - -### 6. Successful Command Execution - -Each `Example` will be tested by executing the `cargo scout-audit` command with the provided paths. The test must be able to execute this command successfully. If the command execution fails, the test will fail. - -### 7. Proper Linter Output Validation - -Each `Example` will be tested by running our Rust linter using the `cargo scout-audit` command. The output generated by this linter is then compared against the `warning_message` specified in the `DetectorConfig`. - -- If the `Example` is a `vulnerable_path`, the linter output (specifically, the `stderr` or error stream) should contain the `warning_message`. If the linter output does not contain the expected warning, the test will fail. -- If the `Example` is a `remediated_path`, the linter output should not contain the `warning_message`. If the linter output still contains the warning, indicating a detected vulnerability, the test will fail. diff --git a/apps/cargo-scout-audit/tests/integration_tests/detectors.rs b/apps/cargo-scout-audit/tests/integration_tests/detectors.rs deleted file mode 100644 index a3f8e616..00000000 --- a/apps/cargo-scout-audit/tests/integration_tests/detectors.rs +++ /dev/null @@ -1,148 +0,0 @@ -use std::collections::HashMap; -use std::io::Read; -use std::path::PathBuf; - -use cargo_scout_audit::startup::{run_scout, OutputFormat, Scout}; -use colored::Colorize; -use configuration::Configuration; -use serde::{Deserialize, Serialize}; - -mod configuration; -mod utils; - -#[derive(Debug, Serialize, Deserialize)] -pub struct Detectors { - detectors: HashMap, -} - -#[derive(Debug, Serialize, Deserialize)] -struct DetectorConfig { - warning_message: String, - testcases: Vec, -} - -#[derive(Debug, Serialize, Deserialize)] -struct Testcase { - vulnerable_path: Option, - remediated_path: Option, -} - -/// Test that all detectors run successfully on testcases and -/// that lint messages match the expected ones. -/// -/// The following environment variable can be used: -/// -/// - `INTEGRATION_TESTS_TO_RUN`: comma separated list of integration tests to run. -/// If not set, all integration tests are run. -#[test] -fn test() { - // Get environment variable to determine integration tests to run - let integration_tests_to_run = std::env::var("INTEGRATION_TESTS_TO_RUN") - .ok() - .map(|e| e.split(',').map(|s| s.to_string()).collect::>()); - let mut ran_integration_tests = - vec![false; integration_tests_to_run.as_ref().map_or(0, |v| v.len())]; - - // Get the configuration - let detectors_config = Configuration::build() - .unwrap_or_else(|_| panic!("{}", "Failed to get the configuration".red().to_string())); - - // Run all integration tests - for detector_config in detectors_config.detectors.iter() { - let detector_name = detector_config.detector.to_string(); - let lint_message = detector_config.detector.get_lint_message(); - - if let Some(integration_tests_to_run) = &integration_tests_to_run { - let integration_tests_to_run_i = integration_tests_to_run - .iter() - .position(|t| t == &detector_name); - match integration_tests_to_run_i { - Some(i) => ran_integration_tests[i] = true, - None => continue, - }; - } - - println!("\n{} {}", "Testing detector:".bright_cyan(), detector_name); - for example in detector_config.testcases.iter() { - if let Some(vulnerable_path) = &example.vulnerable_path { - execute_and_validate_testcase(&detector_name, lint_message, vulnerable_path, true); - } - if let Some(remediated_path) = &example.remediated_path { - execute_and_validate_testcase(&detector_name, lint_message, remediated_path, false); - } - } - } - - // If integration tests to run were specified, check that all of them were run - if let Some(integration_tests_to_run) = &integration_tests_to_run { - let panic_exit = ran_integration_tests.iter().any(|t| !t); - for (i, ran_integration_test) in ran_integration_tests.iter().enumerate() { - if !ran_integration_test { - println!( - "{} {}", - "Error: integration test not found:".bright_red(), - integration_tests_to_run[i] - ); - } - } - if panic_exit { - panic!(); - } - } -} - -fn execute_and_validate_testcase( - detector_name: &str, - lint_message: &str, - path: &str, - is_vulnerable: bool, -) { - print!("{} {}", "Running testcase:".green(), path); - let start_time = std::time::Instant::now(); - - // Create tempfile for storing the output - let mut tempfile = tempfile::NamedTempFile::new().expect("Failed to create tempfile"); - - // Run scout - let scout_config = Scout { - output_format: OutputFormat::Text, - output_path: Some(PathBuf::from(tempfile.path())), - local_detectors: Some(get_detectors_path()), - manifest_path: Some(PathBuf::from(path.to_string())), - filter: Some(detector_name.to_string()), - verbose: true, - ..Default::default() - }; - run_scout(scout_config).unwrap(); - - // Read output - let mut output = String::new(); - tempfile - .read_to_string(&mut output) - .expect("Failed to read tempfile"); - - let end_time = std::time::Instant::now(); - - assert!( - output.contains(lint_message) == is_vulnerable, - "\n\n{}\n\n{}\n\n", - if is_vulnerable { - "Error: vulnerability not found on a vulnerable path".red() - } else { - "Error: vulnerability found on a non vulnerable path".red() - }, - output - ); - - println!( - " - {} {} secs.", - "Elapsed time:".bright_purple(), - end_time.duration_since(start_time).as_millis() as f64 / 1000.0 - ); -} - -fn get_detectors_path() -> PathBuf { - utils::get_repository_root_path() - .expect("Failed to get detectors path") - .join("detectors") -} diff --git a/apps/cargo-scout-audit/tests/integration_tests/detectors/configuration.rs b/apps/cargo-scout-audit/tests/integration_tests/detectors/configuration.rs deleted file mode 100644 index dfab0317..00000000 --- a/apps/cargo-scout-audit/tests/integration_tests/detectors/configuration.rs +++ /dev/null @@ -1,111 +0,0 @@ -use std::path::{Path, PathBuf}; - -use anyhow::{anyhow, bail}; -use itertools::Itertools; -use scout_audit_internal::{Detector, IntoEnumIterator}; - -use super::utils; - -#[derive(Debug)] -pub struct Configuration { - pub detectors: Vec, -} - -#[derive(Debug)] -pub struct DetectorConfiguration { - pub detector: Detector, - pub testcases: Vec, -} - -#[derive(Debug)] -pub struct Testcase { - pub vulnerable_path: Option, - pub remediated_path: Option, -} - -impl Configuration { - pub fn build() -> anyhow::Result { - // Get all testcases folders - let cargo_scout_audit_path = utils::get_cargo_scout_audit_path()?; - let testcases_root_path = cargo_scout_audit_path - .parent() - .ok_or(anyhow!("Failed to find testcases path"))? - .parent() - .ok_or(anyhow!("Failed to find testcases path"))? - .join("test-cases"); - let testcases_paths: Vec = std::fs::read_dir(&testcases_root_path)? - .filter_map(|r| r.ok().map(|f| f.path())) - .filter(|r| r.is_dir()) - .collect(); - - Self::validate_all_detectors_found(testcases_paths)?; - - // Find all testcases for each detector - let mut detectors_config = Vec::new(); - for detector in Detector::iter() { - let detector_name = detector.to_string(); - let testcases_root_path = testcases_root_path.join(detector_name); - let testcases_paths: Vec = std::fs::read_dir(testcases_root_path)? - .filter_map(|r| r.ok().map(|f| f.path())) - .filter(|r| r.is_dir()) - .collect(); - - let mut testcases = Vec::new(); - for testcase_path in testcases_paths { - let vulnerable_path = testcase_path.join("vulnerable-example"); - let remediated_path = testcase_path.join("remediated-example"); - - let testcase = Testcase { - vulnerable_path: if vulnerable_path.exists() { - Some( - vulnerable_path - .join("Cargo.toml") - .to_string_lossy() - .to_string(), - ) - } else { - None - }, - remediated_path: if Path::new(&remediated_path).exists() { - Some( - remediated_path - .join("Cargo.toml") - .to_string_lossy() - .to_string(), - ) - } else { - None - }, - }; - testcases.push(testcase); - } - - detectors_config.push(DetectorConfiguration { - detector, - testcases, - }); - } - - Ok(Configuration { - detectors: detectors_config, - }) - } - - fn validate_all_detectors_found(testcases_paths: T) -> anyhow::Result<()> - where - T: IntoIterator, - { - let count = testcases_paths - .into_iter() - .sorted() - .zip(Detector::iter().map(|d| d.to_string()).sorted()) - .filter(|(p, d)| p.file_name().unwrap().to_string_lossy() != *d) - .count(); - - if count > 0 { - bail!("Testcases don't match detectors defined in scout-audit-internal.") - } - - Ok(()) - } -} diff --git a/apps/cargo-scout-audit/tests/integration_tests/detectors/utils.rs b/apps/cargo-scout-audit/tests/integration_tests/detectors/utils.rs deleted file mode 100644 index f5365a3b..00000000 --- a/apps/cargo-scout-audit/tests/integration_tests/detectors/utils.rs +++ /dev/null @@ -1,14 +0,0 @@ -use std::path::PathBuf; - -use cargo_metadata::MetadataCommand; - -pub fn get_cargo_scout_audit_path() -> cargo_metadata::Result { - Ok(MetadataCommand::new().exec()?.workspace_root.into()) -} - -pub fn get_repository_root_path() -> cargo_metadata::Result { - let mut path = get_cargo_scout_audit_path()?; - path.pop(); - path.pop(); - Ok(path) -} diff --git a/apps/cargo-scout-audit/tests/integration_tests/main.rs b/apps/cargo-scout-audit/tests/integration_tests/main.rs deleted file mode 100644 index 4235583f..00000000 --- a/apps/cargo-scout-audit/tests/integration_tests/main.rs +++ /dev/null @@ -1 +0,0 @@ -mod detectors; diff --git a/apps/scout-extension/.eslintrc.cjs b/apps/scout-extension/.eslintrc.cjs deleted file mode 100644 index bc580155..00000000 --- a/apps/scout-extension/.eslintrc.cjs +++ /dev/null @@ -1,31 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/no-var-requires -const path = require("path"); - -/** @type {import("eslint").Linter.Config} */ -const config = { - root: true, - parser: "@typescript-eslint/parser", - parserOptions: { - ecmaVersion: 6, - sourceType: "module", - project: path.join(__dirname, "tsconfig.json"), - }, - plugins: ["@typescript-eslint"], - extends: [ - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - ], - rules: { - "@typescript-eslint/consistent-type-imports": [ - "warn", - { - prefer: "type-imports", - fixStyle: "inline-type-imports", - }, - ], - "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], - }, - ignorePatterns: ["out", "dist", "**/*.d.ts"], -}; - -module.exports = config; diff --git a/apps/scout-extension/.gitignore b/apps/scout-extension/.gitignore deleted file mode 100644 index 808e1d34..00000000 --- a/apps/scout-extension/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -out/ -*.vsix diff --git a/apps/scout-extension/.npmrc b/apps/scout-extension/.npmrc deleted file mode 100644 index 37d1b604..00000000 --- a/apps/scout-extension/.npmrc +++ /dev/null @@ -1 +0,0 @@ -enable-pre-post-scripts = true \ No newline at end of file diff --git a/apps/scout-extension/.prettierignore b/apps/scout-extension/.prettierignore deleted file mode 100644 index 9209ef5b..00000000 --- a/apps/scout-extension/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -out diff --git a/apps/scout-extension/.vscodeignore b/apps/scout-extension/.vscodeignore deleted file mode 100644 index 38999676..00000000 --- a/apps/scout-extension/.vscodeignore +++ /dev/null @@ -1,10 +0,0 @@ -.vscode/** -.vscode-test/** -src/** -.gitignore -.yarnrc -vsc-extension-quickstart.md -**/tsconfig.json -**/.eslintrc.json -**/*.map -**/*.ts diff --git a/apps/scout-extension/CHANGELOG.md b/apps/scout-extension/CHANGELOG.md deleted file mode 100644 index d72aae61..00000000 --- a/apps/scout-extension/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# Change Log - -All notable changes to the "scout-extension" extension will be documented in this file. - -Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. - -## [Unreleased] - -- Initial release \ No newline at end of file diff --git a/apps/scout-extension/LICENSE b/apps/scout-extension/LICENSE deleted file mode 100644 index 80d9abbe..00000000 --- a/apps/scout-extension/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 CoinFabrik - -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 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/apps/scout-extension/README.md b/apps/scout-extension/README.md deleted file mode 100644 index 9ba6ef09..00000000 --- a/apps/scout-extension/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# Scout: Security Analysis Tool - -

    - Scout in a Dark Forest -

    - -Scout is an extensible open-source tool intended to assist Soroban smart contract developers and auditors detect common security issues and deviations from best practices. This is the vscode extension for Scout. - - -## Features - -- Detection of common security issues and deviations from best practices. -- Line squiggles and hover messages to highlight issues. - -## Requirements - -Before installing the extension, make sure you have the following requirements: - -- [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) extension installed. -- [cargo-scout-audit](https://github.com/CoinFabrik/scout-soroban) installed. -- Rust components installed. - -## Release Notes - -### 0.1.1 - -Fix icon. - -### 0.1.0 - -We're excited to announce the initial release of Scout, the vscode extension. This release lays the groundwork for smart contract developers and auditors, to efficiently identify common security issues and deviations from best practices within their soroban smart contracts. - -We include in this release [detectors and vulnerablity classes with multiple test-cases](https://github.com/CoinFabrik/scout-soroban). - -## About CoinFabrik - -We - [CoinFabrik](https://www.coinfabrik.com/) - are a research and development company specialized in Web3, with a strong background in cybersecurity. Founded in 2014, we have worked on over 180 blockchain-related projects, EVM based and also for Solana, Algorand, and Polkadot. Beyond development, we offer security audits through a dedicated in-house team of senior cybersecurity professionals, currently working on code in Substrate, Solidity, Clarity, Rust, TEAL and Stellar Soroban. - -Our team has an academic background in computer science and mathematics, with work experience focused on cybersecurity and software development, including academic publications, patents turned into products, and conference presentations. Furthermore, we have an ongoing collaboration on knowledge transfer and open-source projects with the University of Buenos Aires. - -## License - -Scout is licensed and distributed under a MIT license. [Contact us](https://www.coinfabrik.com/) if you're looking for an exception to the terms. diff --git a/apps/scout-extension/images/icon.png b/apps/scout-extension/images/icon.png deleted file mode 100644 index 504381529f2c20cb7f195101c8f1c52c75e2a158..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13073 zcmd73WmFtp6EzA01lI(6aJS&WEd)uh5Ii^p3o^st7BmEcySuvto52b0?hLNMB|z}o zy!ZaUKfjN)X0f`@>FFa?r*`dK6Y}Zfdt9vlu#k|Da1}ntsv{vG!=FDGFMvBjgXgut zKTPNcT_+?Y?3d3UWTez|GTMJ<|T7#<}ORtdYZ1!odu;Wm_6sZ{eEL~n4px|uf(Ee(7JT6T&?~t9d@!1he zf9Qi!h3ih{l+*Drmz&keeY@Mvc}BS?8d3d>&5V zaI*J^s8uYf;VXUpMe%rjHc9BvH&Q^&vWu*C!^80?qN=I_!!L&r+Cerv%AF3&;_6?1 zdob{G`ml(&;(!!Z$~}wP@fJgv*3@-dyVUEq5+8`dH3?JHgeMc}Lp&}Fn~(nPqw~Z? zVOD!p3sfHI?+-r|q9S%86beVCqk-DsT~#hjzszsQ(aBv=nZ@%DJr_h(gA(|O(^niY zZPd5#%h&u+$ty+`LE*{R!9#-L$j-7I$RVLtUVNcf(@b-ov`F-X(6{e8j|MEO^yv{P zh=w_LbtGB(HNQZ{dWps?y;n#v!031fz^ccOc&@}kPKW;pk)cS)=!~>~js{x4ao^CQ z)%*koWddWNN#dQ5SNjT*rCsxrE&ioKc_y2H+JTHpNx(1U4b+~_k77FkWy&78Bt~PvL6eC_cJagq&$D`2g>u4$#qx~%<6}x z;qj;)lE66PdNs|&%Y+y>u6&bviWiT~6otQ|ED}K9Du-(`k)xAZio*H8EmK4m zD=7Wnq!A%Gh_G++vShZe5P0*BUs^Ska!WEH;e7&`FjiiVkhz#5a91J;OV|pM1l!L# ziIJ=EkImpw2h6$BR9l%|`5pzAkXzU& zw%}H%jMQdi^p16T*v>6sOb6(lx&vE~K$9 zJ;m;J&ZOgI&X*fiVIhI=$h66zxiqBK2%PwqhI*feS=!aR#5v)EP?>K9kj1x%WE*9z zJIvOP?JJ2`k+;lnl@4STU_DSsc`8+C#~q!EawpJ|X#Q~=PRl`mZr{k zIC1dtx(a-yxsYAf&MawUnO`jutQDx`wIc(`Np~PK%xjoz+>X;LU4q{lUWq&PpiNC* z<@Ed;JJfrCmXiBbtkx}-R+nRb`UK2AJEf1Bqds6?LBZ{5Aqcn8ERZrZR8lw_zjk}m z;_SZGH14uNGh9EZU^V^Z?%4HvDiRuCtq;(3W=F|01O6J*aNUM94y}rSM@3kFU~nk9}fV~+9P0?1gQekfNMWrS7@JBwk$h4oL$%h-%KiGh{fyz(}S z&W9FDCF9}*pWXB^j~i&@8F;IAFJ7H6^yF_2lCjYf&@QCqzPFSo2GSjbyn`zO1Lbkt21LFCF9`tG_O5>{v=% zi$Cw|;J~MHuaI}h`x`n@Y7<`ysi>;y!N3XeL(yw`VIW4~epPPQbFsBZVZ7Sj>Bu2X z;r@QPF2<-`*+j>tQp9Uq-T|o<@XjIcsMqNe@|g*y^Bq&Y2A2|z3)Joo&8V7qF61%EgUdqa9A?RzZ$mpf9Br8L=Jvut#a;b6!gYz)wJ>H z)cbr~Y?bc1nPw@9mD~4e=JeudZZ$f|*h5b6aJO!AQgaJej+ymUUaQjNZc7CNz9cIP zHRsU8b?bYd+lLcenWO&iC()+x?7JPeHrwwf#ElkRRX1kWH{48|ht12eRfWq9N7l%W ze#DemX0AS_6FyDTe-0onS5qfmRrdzlf%h9@4|aVsx(MxdwFIfBE91er!`*uOa@BA3 zLKP3_!bvjJ1W?xSg_}5T7tz|=8RLH*H(PyU5uDRa4*u8MyE@xL9A%CN2|5;tc)_AS zQUB{62(hwnH`lRkZ~vRd_p^No5=b+8y)wUeT~8zShS;a&;50mZ5Nz?dvime2v~v5e z^W&eM5&IUXoL@M@+9wQGuSu{9m%R6pzVRc2M{(CeD)ui@<5sYgpj~t;)9UR6#kt$1 zi4ejQ^E>1!^YjAU=bIpo#Ptn|l#lQ?JA$mINu4eHw!bqxheQo69%h$p$b7)=9M}KX zWE^&zx)gh#mhe=6!b@uDdwY)G6?Fn`V^YABIq}!^IHbCUN#5EHIO!*6J<$jrw%rpe z1Q2@Pj7E@-Vn#b?s?lHTZI;q|pL(AxUpvA0?&h=Z8^dMbqW8a#PGum1G+u`+$4OCb zyDXj6UUTbS^zHWRF^>PvIIa+e0+Y#5i+Ws1_TjER&6>Cv~^9-yssT$o}}RsD7S!?G)_^?Jau zkkP-$^nWM5%w(cZ|e5pBcyD$_wXXKZmgw9V>HGc>N--bV=WU9%R~%e!`vwiGX+M8baFV|MC3REy?W|c!_*8(@F;B1@ zU7nhNb`wK*E72Bz&y_`Qx_ZmLHSw4jVFWpt%$R7LF=#fmvOG>E$s(rYi}I6!p!t0I zb9Grv;$L3Ac6B?|{uY$HGi5#8)_geSEb)NJkc%n^7OXyT4ZIz#0v3~@o^FHb&AX{AMpANLChI( z_l=)|hoL!Zoff+d&Tj4h11Y`5#E`K*hbfU7Uc@Q}sOb}T-sn*B8>>hn2s{kvil!HN<@xcB+<*jIIsJ-rFv$!9Zd#ZEpNXSv`DJ|!qAgGG%3zQnX zL3Qhb$Xg%XNf@N(_!;$3J;k=l@?2tUq{fb1nI@`tJzDFq6cG*P^zD*0QN)yvMZ7b6 zHvvhrB*<=Oe}ZW|y;jFmbLC8gOZDrw3=p-PCtl|3;kYv{ow&=@0W!yMP@K^TVsepw z?buJuSdu7m-Scc_spi{-cAu?dI`BT%ze|Tlo$_hNJydO^5DlXk!a9hhl$lPTmB21| z4+S|G0l+s;36=^@kQmd`iKsXOjrW+c`$7qJ6Zhjx*?G^&Be-w(1b+GO4^(M=C<1VXNT>zUiEC2=~}Rbi%WLiQ4HLOy-T6-4ho{Rk)M zI8*3)eRRVhx-lT`N-K3U;K)t#?;}c7Ut@qRgzDEA#*KQH`EYsLj4dJ4MO+W7tyl9lC2;%{4Se-+?5h_!uQ=S@=yJdNSn~ znPJw}FLkAhPW7qU(k{J}O|5E%3-fnx+$3QI0eNk)at;#CHr;<1^~Y7cojw=x2d?lh@15)4?Rqn z2U`+}f&$*n!y;u1@!9@fKs<5yC4<7w1S!FHt{cdF^(Ok{zOo2!O znyJR6nHh4sm_cDnYBhun>kcw8fziQc=PCz~48FscDP4bSEqV-Jb{st-iq#DRV)u+x zTr;j~AaWkkY*q zkDZb>$S+_qosKK$<{jz10+nNUz+%bG9tR9XUW%Xf!ZWM`z#bS=;IwHNTCj+4qMz~5qxv$naLr( zU|=jJQSlIbq{=-MxIo%iC`^oxR zzUya+U`ubpNL5uvGwfS#p?E#xOUtMGuuLJtUsB&bf5IqVi^i@X@vqF)L#?rS%?Tnj z_^mL_-hWvavMaUvnw{5zlv%!P_o(y_)8;_X!)R*0ANHR=l8=?NG{8az*b?qtQo;tU ztKNjC_Gh_n+7bTbvC@$qI|)pufQ#G09_wPPm~szS(Lz~l8na&9JDer>wr3Oke~<2Z zWIcA$oZL0)V?NA|-OCKbIy7L&I^=AR*4b5)!xZBzRrM{0$+Fgm(4;%)NN=qPp^}#i zO6Xi@58L?n=I&;$+To3Iv~GK09C(1anh7_#; z01#=9hbV7Hn33;(ZPwCtvOe*{obTiB{-xR}OCnBCqbW`;8+M?dj3gO(G2ii&@xR>r z-%0H?C%kSsUr9zcnJ4I@Ntu~u(#h~acqwx>lGN_dllF&s?zZ zZc3f7x71__k(eC+>#37;6pQmaqpR@(t`A0bc-)gI!D(E*WszcPzsR|!a{m_22}-dF z{}NUM@Db)lQWDS%_yyeetO}nbBcE*xF#BHLu+^huKa>yWRM1(! z(YRjqTC;s#_JJQy=ep9q;W1US#@;vWm{{NaWOf3tBRy_?m1=+g8)jW^$ZH(2GGCuC zyQ9w1>~GXcTZ+8bk$QkM_N}&0)STTOIIg=%F=X8yT1Y>|Pdxp4+&7-uGNeVNbE zSvBOP&x%g2@adu&Q#-1wu{>Jlr+f`qc*bN_iA&Lvq)u%Oot+dSsMpCJp6YE3jAl@0FvN>P< zPpk$>--p#QOUNr2*~IjHv+k4HTTae)K2(X^{JVG(nhjGotj>_~%-@9bz-;ciCw;&E z;10^24$X#s{!QmpxazPK@DRV3z`~^rX+LYauibodUfuM40tat(;kOzBfdqWxYd>r8 zN{mBLr{d2jBKNR-u}#BEmq$FWC$qiv9xR>1cr8fwq2utrGxxz+p?8ZR;pKTsfhsi| z6QSF7Q}bHKejwYkVm^JQsw((;IB*K0Ch(hlyATd{;r(!GZ{Zf!Dc z=L=R_{onDa|1APJL~PWjv+C%l0t+RNtyy6*R7S zpA&4~*IAEU+>>xBeg^esC$mda>2(6=hgOB)C8MnSe;fWAaa0h2YXA@j?OGot#k#($ zW{UFT-~!>52$p~cAWdN1t1$kCGrF}1s+q+LWghyTs|_J_Os97&bi@SO3~xTPG`)tg$wg zlbF(Fy(qqP{^Qn`3FkFyNgzp+qIq2i%1ux^}*HJHPrAj~V_r zo{sEa?$@1t3{%tmX89Ad1y?!;fWxJAT%s;8%-62pVr`j{CwCc7mz_iNuIwFj!{Ib1 zFVYAbzkRq<1#9XMd8uK;)Dw)Xn38b)V+Ln$+2xqg-gVFs-(oc&lk+OMLCOu|QK`7H zipf+ZxIai72Xat1u=1*L%>zsdSAD1=36uO_n^{sI0N?aYZxxyC2p~N&G?dI6r+F;w zi^VJl%w&}%Vp_wY-ISw0lXz?BpZDKvI{=^(e}64uY?XpcyBkf1r^R+!`j)cg0gxxy zuj}(6t|0kKGg!f`htd4JL@hB%@jri|qHvgg`DC)qw5w0cL{!DM3 zvJ?v|<%%1Es&hl5~Yr~ zxKyohhg~EA&hgn`O2}=#Af>Fh74XIMY$%2>W3E8Nmi4+F*2{*9?`D_#E}kUVKiL(# zA+A2_--xtgI(YCr9(ASZZb04L3HNtWH^){-_)?})mZ%?s`wFSW9h=Vvhq$q@esC&w zcUCTv9I?Qd2By99Cwl9yXg)gD;7$f}Duy3E^QL!yVhJDsjf-oxRhsDT)#|%@8c`W>Fq~NwaY0mv*<%R9MU`^NF5GI)?yC zmMrE}yA-R66-}$^5q1;>n1oFpz*GM4>w0?(WLP*>5HfVPJTG@IPYP1UFaN3bXCov6 zSYLtgyq&xui^WA~WG^>w#^isbH)|Qzi8G<_gi_3h1^LOWrjo`wdI|KhhzniZUuts< zN~X=sSp0FyZpd?ym>9B;0r=_L4S?#}<5d2+MAGi&vtF?9Ub3#Lx@6UBrA~17TH7L* zEZIDu4XzLS;U|L?2$N-P-3oEjr|@X#ixaBjRkGKf%OrdS_)I2Zzd}Hqy#Iv|n%saE zjB{YH0uDcYC9wc4!{E`S$ep=)E1;b!b*a=A6MRHBq}HrTPLc!nx{Y@~_L#9g%Ut?w zb!F=(H;ZM^%Y;>R_g zE2~oxrequ!&I8b_)2hwjlIj)%6$y^e!Ld5baLtBUoolrCC9KuNUfu1I0=(4*!o6GG z2FeNUQq~ErH7i@MNr(pLNefbw5nG{AeiR3hHNH@v0JJ$J?kaeQs?B9oXDSJG?p8b!+43H1@ z?p0*!GG6r`%CDy&jRN zUa7f1_iy$KkpWpFm}{DRAQ`eN7W_9p&GI)pm&6WW%2X$>4qbf)j}Uw4$iW{*Fpn2r zSDiS^Z;rZt?kNbfYHA0_)1nyt1RzaZ+Q$c6Pxj*eaAkJ6V6w74R7UUbOHD=ksz&P% zd9UA+0%PyLBKZW z{7QU;Op7QR8))0IfIAjx8Ms%<{8I2_{c~$Mn3-0i-t`GXm~tzKV^{jRgft1QWR2ap zIirhB?Nyu!D=H-(pL$IC9^d6gA+3O*Mf3C@+ujcfesl!T`67{4#`mJ-8-?{_dzG(J zNZL0A^VLgVUBXS%$R&VwmT^Z-M|rQEjzrtfDr^Y8Xp+G>!v?xM?9BL`RhlM-wQ5yr z7FpJ_QQ54sWMb)30dzdsG9{>z9~Xx3;gq!)>*h`alkm)AHlfDL`~b|B{v-J#k0McT z)mG0|_UDCI+`723-KKh-u9o{5IX_T)V%IuzpJ#BW`c~c^mD07o;mlDtmP#w6NL(9g zO_;pqdS|x2+V_#TRq>anj4IFry!{68j&P*AFsGzbDWv$Qx8p<{O1lQq|LgD9#bw-p zJ@bj8pAN)@D{3cX!w~ge%Fsstpll9x@3~oEds}cVo;Ofe&jkU|oFI-5HC@;PxS(9x zHFb8I=3gGvl*><+I<84*&&p~uJf)6KIXt*Sy4aT2j7`t1$K5i+=5C4c9G!lY{22 zY3k%NE=ogW4Lr5I{QKcZD70(i6B4>Bh2e0lKClCTeP55p({QjQ)aFdeW#>D>zva@u z&B73No^C1QsGW&_4tysReOlKbodUOk>%zGNvIbWEepVOhXG7bgYgSoR^vGza+X*ke z2sr#z1_z>0w=U)FyN;Zsv{l-6f0kjMVOj>yQDPAnY!RVF+lFBeN>PApu~o!j$gC-LA-AcDemSO}$w{-j$_t3s z{q;t;s~?J5cZ($6K}OvlYhPv1VgV#9zv7X$(nl2m#enj8H=jk$Ekw1YF_mYcZo=31 z05LzE>FW2^i8_gCF;2tFcg2ONNV)MCO%=O3m?%3e#j#)u(BflF#m-OU+TY%lGQCaZrZ0D_nJDmNw%ovWOyx|hbGM46(IXDPVP~!=qa2;H-+QwO} z_c5YB()Ax)?j*NpwBq+{Tz!6HM1%Y*rCPMSf6e|maIN0~fejZ!LjbjCwYahZ11p&L zIr6chUw()(62gEdq~q4IEYj@8PH)h!jT1&pd?0rF{x)jApDhH=n;Uf^BdLNp?q4)b zZu*^wZA06vR?11-?q0jXe;Dvm5~p?vZmu~M0*^2+TlT@wY#@xtVvX@Dec;Xg|8hDeW z6TZTYSP?dPcGoN7d`3C*;ZSesa<)9hTr!Q>uwTed0MuOnXbez_UuBMCyN7?`&QQ3? z5dZAN!n+$DT_Vk=4@xs6M5VWS&X4*Thp%!=jp6~;- zV$Mn2EHegP@44m&na}O!a&x6Ks_iTOus9aIxS(}p8|y!$zU-RAYk5PR(lqIVeFe0B zG-^<)5?<-Ivs?M>ot?$f`#ARLpl4(sTL*P7fKw5%eWR*4L8jHJVR+<_xT!6{-0H1) zh2R0`*IJNwZQoQ;gj-u>K%Yf-2QS|TCBK?6fiu+f#Gycn+utNi?@Vp|`g33X)IUSD zybF=cOlc!>(!nv)$sC!yub(TDhzV&rYUvEfl1)C|OatH^8&i}WD z#n@!nUIP$pPC1AKuWrm~s_1<{F33Jc@wf9xx5B=3Vh-#CQ zT;5o%V;3!k@S8F;rqA&p2Rg^1F;XQ82+Z8zaPV;SR&S1YFfn|m?LEopSN>a%gegzNj zf8alK(|6v}XVWVayp|7S2IGA9;}CW$DOtYNiw8|ymH*1B7@&&i)f~A7k)v~dPq)Pd ztI1E7J%O`Kd)t1jlccYd8(DRe1j)xJ{3bu@k+h(nse6sD9?c8sWo!;`T8iVNhj~(* zzP4MdkOL1Btp}+QLeX3S?nOO@`CXt^oH`Bsk9(Pjz5}ITEZ(Yc0}HxdtB7TFsEQ8N zt)&a+;|>%6`8uB}tGj=)O)u!TYsJNVL2;KO5?buZ>P;^DuFdz6;wi+3r5J9_v7CDB zFHHbN)4Kk9p-x+A!*|5ABj|Tmsz{mWt-&v3)72yxQDpwMvcS~o!4`k%Xx&MWE>Fj) zxBMqw7M_`6kAs~pgnI@D-K(iy_U<|!Gf^#t7CnC|#sLFAn?XQ;Mng988?A8aT zOTk<0T0R>{vNYwx(~HgGOq?e?I~)NGCuLtrS_rCvw6g8fXT!g2*Jju6inKm0>$SJJ z^=>%TUSKQ5GRUV`g!l_ODiYy*1i6(Coe7ZV(Q-6I*{bV>5nSMJ4|%pE6Ma#Ttz zj|J=YeIuUp!`_ebM;sKIPFtUSU&^_byfV7N`U}XRx!fCZugE;!$|v>TEPXUi3C|$^ zsuwC~1E}`&YbGTIft?w2-zo`^vno!K|g{f@)1hE?uyRd~L1Uy;xEECa|W=AJUQsC=6QBg^07 z>M$qKPGP`7wO00|=RP#)Cn`}j5C7c(@>b;`fb^@JgaN606WD4Sa66}~ckDn9HX;{? zF62l-M<69AMrWk99l4Cn9|sstKUl>kFEjG~3;%Q?ilMK&llP1kT`wQ5dBBckB$X6B zN~o6?Uu4c0ubE2_!Yoz+xpiBB`dT&tsF=#JjBhKgYv-bMcFL{b|_)3@yZIKcdD*Jtsf zahIg;1lBlb9j?(Ln{&jtuD~h^e$NZB|Iwx1N=g$R%PTF%H&%voZg)56BiQgs$dbuI zKMuvg7afj{r`tnLDT;M39;olcL^K+IC^IigICrSfd`XeqE26-Vr}!Wa)@Zo%q>h#c zP@CdyYO=#(Vs_ONx2snTJ?{i_ntq%Y)%lDXG9Mt-SRJP(r}G%KKlq%zX=^SW5Gu2M znJlotJ!Om?c;YtYUx}kO=++1nR6Gnj zN5on+bgjCl8L{KpFVFHr!&!-InZ4%!vwJs$aK0G9ixxqpq({@kBO$H(q2D{~qTkr< zQugjYOO-1=!1-|h-n&;)fqH=|55}1*uGI=`ZXq$m*3O--7&k8P*5} zGAoWMr{gg*_sAgZVw>slRSd@Sn|t0vllv-Z{`LyVVg|0ng>M@Opg)~=dl%)NW2cT_ znn(MLNDv^tm#+jBwBEmY$P-SM3yHi<(Me${1W5kVvxy*8NLVAA$gF7a(4n%*tCt+Y zv_bm=oh-|xQEy$-{RY%H^WantbGs4imQnglYW zZ^V!&?`~p%Aso(5j7(Z=vXDU>q%$?29ru%>Or_gQ|Lp#Te}+`p&KCU$)c+qK3-OrY zEw9`-e14UOB82T|eCj?(i9v7N@E%{dpr$^6qUJoo71k5G4sE& zIa-}_U|c|Q*6vL>BJFb#UpVa= z&wmM#GfG8Y2;G=>J#P?4=n5)dCfLQSpcTF!yQ=geN-&}c0WHcDpo>?}Y=J~JmXd%f zd9A@*)~u9waRf;*!77r9rey>v`MJC>rfN%I;Ag)+{fqo~H+est=kI3_P(W*El;OdZ zI3I-AK6uhwc`2OAMl=LCwFjvI(u+S(Z1FFXYk;6|`;!Wm#a}_z)o~4DG9TNSR8P!Zlp1l$ST%h z(;fl0^Qr$?FRY|dT%pY+JL80ZoV2@f7m2j>zdDx);$~O|dYC`wj`3tyXgVG@_`+xR z|EijJsmm<$|3eNY%Qqw09RGozm%duC)s&q{G~ZeO)S?8+2NF86>0b2D<55ZYX=5(yBV>B1+DV{D?DJ} zu!*ID`hgdO$8b@PIJ|NJ4^JL5`cfIhpyGOFgcZrth!F#)zxwc3t=K@G2~=zO4pZ~v z6@foI6Wy6p(<|kb615i>rwvEuMOm+}?qu&a3_{Hgj-#vOsZG)u8JK?&Tf+1y{S*L) zN-9&sXU|Joq^aeGm&_O9+|wrVGfLd!E|}%WCNR?R?|ibX#CmrI_|uQcosQW&{Z_EH zG2HRA@m543T5bQG)Yug7WjkBktxt8g_OQZAEqXX`fW7VnE7rCfb`3l5>l2j5f$m-w-U&5ti&MACvh$yP(P0}!n+Ps-_z|!zr z9N+?EQj_AK0&Dv|yA~*XzglHfY=VWu)?bR!{ zXGXM#iOtN&hW+pZ@LF;)^iFw5<3W6`o^pC_4$_2_A-H0FH@=;@%3xC>5XqsQj>awc ziS&enI~*aL885w}{P(fvb1U5ghOlzFM6_`{Scd}4>Ob*mBn{nA$8V6U|EQK ztMn#Z@rdMG9@;vY&~S*vPg~NK9;Nv=M+z zsbvI|m*S4i;bn#~H6Il*&c?dw{7%^^9c<+=t{AzglmL&+oI0B9_hAT`55yy})lRf9 z-T$@oFjX_?a=o+RLY5y63U!d_(t<*~B3O>_HN3TFZmk}a56o6)q#&b=dGKfpJ2m=C z%Sg`jRNluCMq@ieG5<1nygL|9OhkvQ{DMO`KhqX_J~ohC>*Lzd3PRs#v%F6GJyLHN zzwoO}F%BgglNu{co4XCa7NDllJ)$JY7FD&7R#xG)+bA*_C4l{>^gb#$?p%>TkjQ92 zct465mxUZr$nb!g_GL446Z+?BeEowtdrZGyK!qbYkq)oYw zoKw(I)rWWSyybZQm~_Bf^dZ!F3Wp$75MDB%9!I-#ODw-H`E1XIG%f{PE-R^;8H26= z_$;vdZ4p5I0_S?|=HG-q*rWx`&Y^b5LJje%-Vn2Kqg->giY|>x-J1>D~i%lFHxwB+kg=1Wfut(foY`y+e|{kQbHl)_en<&Aldwg zr2GnqXzy&9+=jo_PG1X=FN`myvmpGOP0-N)5>)Om7SGQhbnmj17anz{TD&{p4Iqt| v1==769oVc+N%H^6UtRqFyjyth2}R>;wh422TEp`XLlopb%2vKJ3HW~i+PDIU diff --git a/apps/scout-extension/package.json b/apps/scout-extension/package.json deleted file mode 100644 index 9cc67d55..00000000 --- a/apps/scout-extension/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "scout-audit", - "displayName": "Scout Audit", - "description": "Soroban smart contract linter", - "version": "0.1.1", - "repository": "https://github.com/CoinFabrik/scout", - "engines": { - "vscode": "^1.78.0" - }, - "publisher": "CoinFabrik", - "icon": "images/icon.png", - "keywords": [ - "rust" - ], - "categories": [ - "Programming Languages" - ], - "activationEvents": [ - "onLanguage:rust", - "workspaceContains:*/Cargo.toml", - "workspaceContains:*/rust-project.json" - ], - "main": "./out/extension.js", - "scripts": { - "vscode:prepublish": "npm run esbuild-base -- --minify", - "esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node", - "esbuild": "npm run esbuild-base -- --sourcemap", - "esbuild-watch": "npm run esbuild-base -- --sourcemap --watch", - "package": "pnpm vsce package --no-dependencies", - "publish": "pnpm vsce publish --no-dependencies", - "test-compile": "tsc -p ./", - "watch": "tsc -watch -p ./", - "pretest": "pnpm run test-compile && pnpm run lint", - "lint": "eslint src --ext ts", - "format": "prettier --write src/**/*.ts", - "test": "node ./out/test/runTest.js" - }, - "dependencies": { - "command-exists": "^1.2.9", - "toml": "^3.0.0" - }, - "devDependencies": { - "@types/command-exists": "^1.2.0", - "@types/glob": "^8.1.0", - "@types/mocha": "^10.0.1", - "@types/node": "16.x", - "@types/vscode": "^1.78.0", - "@typescript-eslint/eslint-plugin": "^5.59.1", - "@typescript-eslint/parser": "^5.59.1", - "@vscode/test-electron": "^2.3.0", - "esbuild": "^0.17.19", - "eslint": "^8.39.0", - "glob": "^8.1.0", - "mocha": "^10.2.0", - "prettier": "^2.8.8", - "typescript": "^5.0.4" - } -} diff --git a/apps/scout-extension/pnpm-lock.yaml b/apps/scout-extension/pnpm-lock.yaml deleted file mode 100644 index 186d0125..00000000 --- a/apps/scout-extension/pnpm-lock.yaml +++ /dev/null @@ -1,1656 +0,0 @@ -lockfileVersion: '6.1' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -dependencies: - command-exists: - specifier: ^1.2.9 - version: 1.2.9 - toml: - specifier: ^3.0.0 - version: 3.0.0 - -devDependencies: - '@types/command-exists': - specifier: ^1.2.0 - version: 1.2.0 - '@types/glob': - specifier: ^8.1.0 - version: 8.1.0 - '@types/mocha': - specifier: ^10.0.1 - version: 10.0.1 - '@types/node': - specifier: 16.x - version: 16.0.0 - '@types/vscode': - specifier: ^1.78.0 - version: 1.78.0 - '@typescript-eslint/eslint-plugin': - specifier: ^5.59.1 - version: 5.59.1(@typescript-eslint/parser@5.59.1)(eslint@8.39.0)(typescript@5.0.4) - '@typescript-eslint/parser': - specifier: ^5.59.1 - version: 5.59.1(eslint@8.39.0)(typescript@5.0.4) - '@vscode/test-electron': - specifier: ^2.3.0 - version: 2.3.0 - esbuild: - specifier: ^0.17.19 - version: 0.17.19 - eslint: - specifier: ^8.39.0 - version: 8.39.0 - glob: - specifier: ^8.1.0 - version: 8.1.0 - mocha: - specifier: ^10.2.0 - version: 10.2.0 - prettier: - specifier: ^2.8.8 - version: 2.8.8 - typescript: - specifier: ^5.0.4 - version: 5.0.4 - -packages: - - /@esbuild/android-arm64@0.17.19: - resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/android-arm@0.17.19: - resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/android-x64@0.17.19: - resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/darwin-arm64@0.17.19: - resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@esbuild/darwin-x64@0.17.19: - resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@esbuild/freebsd-arm64@0.17.19: - resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/freebsd-x64@0.17.19: - resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-arm64@0.17.19: - resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-arm@0.17.19: - resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-ia32@0.17.19: - resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-loong64@0.17.19: - resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-mips64el@0.17.19: - resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-ppc64@0.17.19: - resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-riscv64@0.17.19: - resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-s390x@0.17.19: - resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-x64@0.17.19: - resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/netbsd-x64@0.17.19: - resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/openbsd-x64@0.17.19: - resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/sunos-x64@0.17.19: - resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-arm64@0.17.19: - resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-ia32@0.17.19: - resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-x64@0.17.19: - resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@eslint-community/eslint-utils@4.4.0(eslint@8.39.0): - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - dependencies: - eslint: 8.39.0 - eslint-visitor-keys: 3.4.1 - dev: true - - /@eslint-community/regexpp@4.5.1: - resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - dev: true - - /@eslint/eslintrc@2.0.3: - resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) - espree: 9.5.2 - globals: 13.20.0 - ignore: 5.2.4 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - - /@eslint/js@8.39.0: - resolution: {integrity: sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /@humanwhocodes/config-array@0.11.8: - resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} - engines: {node: '>=10.10.0'} - dependencies: - '@humanwhocodes/object-schema': 1.2.1 - debug: 4.3.4(supports-color@8.1.1) - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /@humanwhocodes/module-importer@1.0.1: - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} - dev: true - - /@humanwhocodes/object-schema@1.2.1: - resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} - dev: true - - /@nodelib/fs.scandir@2.1.5: - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - dev: true - - /@nodelib/fs.stat@2.0.5: - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - dev: true - - /@nodelib/fs.walk@1.2.8: - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.15.0 - dev: true - - /@tootallnate/once@1.1.2: - resolution: {integrity: sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==} - engines: {node: '>= 6'} - dev: true - - /@types/command-exists@1.2.0: - resolution: {integrity: sha512-ugsxEJfsCuqMLSuCD4PIJkp5Uk2z6TCMRCgYVuhRo5cYQY3+1xXTQkSlPtkpGHuvWMjS2KTeVQXxkXRACMbM6A==} - dev: true - - /@types/glob@8.1.0: - resolution: {integrity: sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==} - dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 16.0.0 - dev: true - - /@types/json-schema@7.0.12: - resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} - dev: true - - /@types/minimatch@5.1.2: - resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - dev: true - - /@types/mocha@10.0.1: - resolution: {integrity: sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==} - dev: true - - /@types/node@16.0.0: - resolution: {integrity: sha512-TmCW5HoZ2o2/z2EYi109jLqIaPIi9y/lc2LmDCWzuCi35bcaQ+OtUh6nwBiFK7SOu25FAU5+YKdqFZUwtqGSdg==} - dev: true - - /@types/semver@7.5.0: - resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} - dev: true - - /@types/vscode@1.78.0: - resolution: {integrity: sha512-LJZIJpPvKJ0HVQDqfOy6W4sNKUBBwyDu1Bs8chHBZOe9MNuKTJtidgZ2bqjhmmWpUb0TIIqv47BFUcVmAsgaVA==} - dev: true - - /@typescript-eslint/eslint-plugin@5.59.1(@typescript-eslint/parser@5.59.1)(eslint@8.39.0)(typescript@5.0.4): - resolution: {integrity: sha512-AVi0uazY5quFB9hlp2Xv+ogpfpk77xzsgsIEWyVS7uK/c7MZ5tw7ZPbapa0SbfkqE0fsAMkz5UwtgMLVk2BQAg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.59.1(eslint@8.39.0)(typescript@5.0.4) - '@typescript-eslint/scope-manager': 5.59.1 - '@typescript-eslint/type-utils': 5.59.1(eslint@8.39.0)(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.1(eslint@8.39.0)(typescript@5.0.4) - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.39.0 - grapheme-splitter: 1.0.4 - ignore: 5.2.4 - natural-compare-lite: 1.4.0 - semver: 7.5.1 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/parser@5.59.1(eslint@8.39.0)(typescript@5.0.4): - resolution: {integrity: sha512-nzjFAN8WEu6yPRDizIFyzAfgK7nybPodMNFGNH0M9tei2gYnYszRDqVA0xlnRjkl7Hkx2vYrEdb6fP2a21cG1g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/scope-manager': 5.59.1 - '@typescript-eslint/types': 5.59.1 - '@typescript-eslint/typescript-estree': 5.59.1(typescript@5.0.4) - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.39.0 - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/scope-manager@5.59.1: - resolution: {integrity: sha512-mau0waO5frJctPuAzcxiNWqJR5Z8V0190FTSqRw1Q4Euop6+zTwHAf8YIXNwDOT29tyUDrQ65jSg9aTU/H0omA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.59.1 - '@typescript-eslint/visitor-keys': 5.59.1 - dev: true - - /@typescript-eslint/type-utils@5.59.1(eslint@8.39.0)(typescript@5.0.4): - resolution: {integrity: sha512-ZMWQ+Oh82jWqWzvM3xU+9y5U7MEMVv6GLioM3R5NJk6uvP47kZ7YvlgSHJ7ERD6bOY7Q4uxWm25c76HKEwIjZw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 5.59.1(typescript@5.0.4) - '@typescript-eslint/utils': 5.59.1(eslint@8.39.0)(typescript@5.0.4) - debug: 4.3.4(supports-color@8.1.1) - eslint: 8.39.0 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/types@5.59.1: - resolution: {integrity: sha512-dg0ICB+RZwHlysIy/Dh1SP+gnXNzwd/KS0JprD3Lmgmdq+dJAJnUPe1gNG34p0U19HvRlGX733d/KqscrGC1Pg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /@typescript-eslint/typescript-estree@5.59.1(typescript@5.0.4): - resolution: {integrity: sha512-lYLBBOCsFltFy7XVqzX0Ju+Lh3WPIAWxYpmH/Q7ZoqzbscLiCW00LeYCdsUnnfnj29/s1WovXKh2gwCoinHNGA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.59.1 - '@typescript-eslint/visitor-keys': 5.59.1 - debug: 4.3.4(supports-color@8.1.1) - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.5.1 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/utils@5.59.1(eslint@8.39.0)(typescript@5.0.4): - resolution: {integrity: sha512-MkTe7FE+K1/GxZkP5gRj3rCztg45bEhsd8HYjczBuYm+qFHP5vtZmjx3B0yUCDotceQ4sHgTyz60Ycl225njmA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.39.0) - '@types/json-schema': 7.0.12 - '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.59.1 - '@typescript-eslint/types': 5.59.1 - '@typescript-eslint/typescript-estree': 5.59.1(typescript@5.0.4) - eslint: 8.39.0 - eslint-scope: 5.1.1 - semver: 7.5.1 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/visitor-keys@5.59.1: - resolution: {integrity: sha512-6waEYwBTCWryx0VJmP7JaM4FpipLsFl9CvYf2foAE8Qh/Y0s+bxWysciwOs0LTBED4JCaNxTZ5rGadB14M6dwA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.59.1 - eslint-visitor-keys: 3.4.1 - dev: true - - /@vscode/test-electron@2.3.0: - resolution: {integrity: sha512-fwzA9RtazH1GT/sckYlbxu6t5e4VaMXwCVtyLv4UAG0hP6NTfnMaaG25XCfWqlVwFhBMcQXHBCy5dmz2eLUnkw==} - engines: {node: '>=16'} - dependencies: - http-proxy-agent: 4.0.1 - https-proxy-agent: 5.0.1 - jszip: 3.10.1 - semver: 7.5.1 - transitivePeerDependencies: - - supports-color - dev: true - - /acorn-jsx@5.3.2(acorn@8.8.2): - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - acorn: 8.8.2 - dev: true - - /acorn@8.8.2: - resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} - engines: {node: '>=0.4.0'} - hasBin: true - dev: true - - /agent-base@6.0.2: - resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} - engines: {node: '>= 6.0.0'} - dependencies: - debug: 4.3.4(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - dev: true - - /ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - dev: true - - /ansi-colors@4.1.1: - resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} - engines: {node: '>=6'} - dev: true - - /ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - dev: true - - /ansi-styles@4.3.0: - resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} - engines: {node: '>=8'} - dependencies: - color-convert: 2.0.1 - dev: true - - /anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - dev: true - - /argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - dev: true - - /array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - dev: true - - /balanced-match@1.0.2: - resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - dev: true - - /binary-extensions@2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} - engines: {node: '>=8'} - dev: true - - /brace-expansion@1.1.11: - resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} - dependencies: - balanced-match: 1.0.2 - concat-map: 0.0.1 - dev: true - - /brace-expansion@2.0.1: - resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - dependencies: - balanced-match: 1.0.2 - dev: true - - /braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - dependencies: - fill-range: 7.0.1 - dev: true - - /browser-stdout@1.3.1: - resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} - dev: true - - /callsites@3.1.0: - resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} - engines: {node: '>=6'} - dev: true - - /camelcase@6.3.0: - resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} - engines: {node: '>=10'} - dev: true - - /chalk@4.1.2: - resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - dev: true - - /chokidar@3.5.3: - resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.2 - dev: true - - /cliui@7.0.4: - resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} - dependencies: - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 7.0.0 - dev: true - - /color-convert@2.0.1: - resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} - engines: {node: '>=7.0.0'} - dependencies: - color-name: 1.1.4 - dev: true - - /color-name@1.1.4: - resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - dev: true - - /command-exists@1.2.9: - resolution: {integrity: sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==} - dev: false - - /concat-map@0.0.1: - resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - dev: true - - /core-util-is@1.0.3: - resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - dev: true - - /cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} - engines: {node: '>= 8'} - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - dev: true - - /debug@4.3.4(supports-color@8.1.1): - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - supports-color: 8.1.1 - dev: true - - /decamelize@4.0.0: - resolution: {integrity: sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==} - engines: {node: '>=10'} - dev: true - - /deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - dev: true - - /diff@5.0.0: - resolution: {integrity: sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==} - engines: {node: '>=0.3.1'} - dev: true - - /dir-glob@3.0.1: - resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} - engines: {node: '>=8'} - dependencies: - path-type: 4.0.0 - dev: true - - /doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dependencies: - esutils: 2.0.3 - dev: true - - /emoji-regex@8.0.0: - resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - dev: true - - /esbuild@0.17.19: - resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/android-arm': 0.17.19 - '@esbuild/android-arm64': 0.17.19 - '@esbuild/android-x64': 0.17.19 - '@esbuild/darwin-arm64': 0.17.19 - '@esbuild/darwin-x64': 0.17.19 - '@esbuild/freebsd-arm64': 0.17.19 - '@esbuild/freebsd-x64': 0.17.19 - '@esbuild/linux-arm': 0.17.19 - '@esbuild/linux-arm64': 0.17.19 - '@esbuild/linux-ia32': 0.17.19 - '@esbuild/linux-loong64': 0.17.19 - '@esbuild/linux-mips64el': 0.17.19 - '@esbuild/linux-ppc64': 0.17.19 - '@esbuild/linux-riscv64': 0.17.19 - '@esbuild/linux-s390x': 0.17.19 - '@esbuild/linux-x64': 0.17.19 - '@esbuild/netbsd-x64': 0.17.19 - '@esbuild/openbsd-x64': 0.17.19 - '@esbuild/sunos-x64': 0.17.19 - '@esbuild/win32-arm64': 0.17.19 - '@esbuild/win32-ia32': 0.17.19 - '@esbuild/win32-x64': 0.17.19 - dev: true - - /escalade@3.1.1: - resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} - engines: {node: '>=6'} - dev: true - - /escape-string-regexp@4.0.0: - resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} - engines: {node: '>=10'} - dev: true - - /eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - dev: true - - /eslint-scope@7.2.0: - resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - dev: true - - /eslint-visitor-keys@3.4.1: - resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /eslint@8.39.0: - resolution: {integrity: sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - hasBin: true - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.39.0) - '@eslint-community/regexpp': 4.5.1 - '@eslint/eslintrc': 2.0.3 - '@eslint/js': 8.39.0 - '@humanwhocodes/config-array': 0.11.8 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4(supports-color@8.1.1) - doctrine: 3.0.0 - escape-string-regexp: 4.0.0 - eslint-scope: 7.2.0 - eslint-visitor-keys: 3.4.1 - espree: 9.5.2 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - find-up: 5.0.0 - glob-parent: 6.0.2 - globals: 13.20.0 - grapheme-splitter: 1.0.4 - ignore: 5.2.4 - import-fresh: 3.3.0 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-sdsl: 4.4.0 - js-yaml: 4.1.0 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.1 - strip-ansi: 6.0.1 - strip-json-comments: 3.1.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - dev: true - - /espree@9.5.2: - resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - acorn: 8.8.2 - acorn-jsx: 5.3.2(acorn@8.8.2) - eslint-visitor-keys: 3.4.1 - dev: true - - /esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} - engines: {node: '>=0.10'} - dependencies: - estraverse: 5.3.0 - dev: true - - /esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - dependencies: - estraverse: 5.3.0 - dev: true - - /estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - dev: true - - /estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - dev: true - - /esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - dev: true - - /fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: true - - /fast-glob@3.2.12: - resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} - engines: {node: '>=8.6.0'} - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.5 - dev: true - - /fast-json-stable-stringify@2.1.0: - resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} - dev: true - - /fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - dev: true - - /fastq@1.15.0: - resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} - dependencies: - reusify: 1.0.4 - dev: true - - /file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} - dependencies: - flat-cache: 3.0.4 - dev: true - - /fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - dependencies: - to-regex-range: 5.0.1 - dev: true - - /find-up@5.0.0: - resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} - engines: {node: '>=10'} - dependencies: - locate-path: 6.0.0 - path-exists: 4.0.0 - dev: true - - /flat-cache@3.0.4: - resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} - engines: {node: ^10.12.0 || >=12.0.0} - dependencies: - flatted: 3.2.7 - rimraf: 3.0.2 - dev: true - - /flat@5.0.2: - resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} - hasBin: true - dev: true - - /flatted@3.2.7: - resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} - dev: true - - /fs.realpath@1.0.0: - resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} - dev: true - - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} - engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /get-caller-file@2.0.5: - resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} - engines: {node: 6.* || 8.* || >= 10.*} - dev: true - - /glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - dependencies: - is-glob: 4.0.3 - dev: true - - /glob-parent@6.0.2: - resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} - engines: {node: '>=10.13.0'} - dependencies: - is-glob: 4.0.3 - dev: true - - /glob@7.2.0: - resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 3.1.2 - once: 1.4.0 - path-is-absolute: 1.0.1 - dev: true - - /glob@8.1.0: - resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} - engines: {node: '>=12'} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.1.6 - once: 1.4.0 - dev: true - - /globals@13.20.0: - resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.20.2 - dev: true - - /globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} - dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.2.12 - ignore: 5.2.4 - merge2: 1.4.1 - slash: 3.0.0 - dev: true - - /grapheme-splitter@1.0.4: - resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} - dev: true - - /has-flag@4.0.0: - resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} - engines: {node: '>=8'} - dev: true - - /he@1.2.0: - resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} - hasBin: true - dev: true - - /http-proxy-agent@4.0.1: - resolution: {integrity: sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==} - engines: {node: '>= 6'} - dependencies: - '@tootallnate/once': 1.1.2 - agent-base: 6.0.2 - debug: 4.3.4(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - dev: true - - /https-proxy-agent@5.0.1: - resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} - engines: {node: '>= 6'} - dependencies: - agent-base: 6.0.2 - debug: 4.3.4(supports-color@8.1.1) - transitivePeerDependencies: - - supports-color - dev: true - - /ignore@5.2.4: - resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} - engines: {node: '>= 4'} - dev: true - - /immediate@3.0.6: - resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} - dev: true - - /import-fresh@3.3.0: - resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} - engines: {node: '>=6'} - dependencies: - parent-module: 1.0.1 - resolve-from: 4.0.0 - dev: true - - /imurmurhash@0.1.4: - resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} - engines: {node: '>=0.8.19'} - dev: true - - /inflight@1.0.6: - resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - dependencies: - once: 1.4.0 - wrappy: 1.0.2 - dev: true - - /inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - dev: true - - /is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - dependencies: - binary-extensions: 2.2.0 - dev: true - - /is-extglob@2.1.1: - resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} - engines: {node: '>=0.10.0'} - dev: true - - /is-fullwidth-code-point@3.0.0: - resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} - engines: {node: '>=8'} - dev: true - - /is-glob@4.0.3: - resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} - engines: {node: '>=0.10.0'} - dependencies: - is-extglob: 2.1.1 - dev: true - - /is-number@7.0.0: - resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} - engines: {node: '>=0.12.0'} - dev: true - - /is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - dev: true - - /is-plain-obj@2.1.0: - resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} - engines: {node: '>=8'} - dev: true - - /is-unicode-supported@0.1.0: - resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} - engines: {node: '>=10'} - dev: true - - /isarray@1.0.0: - resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - dev: true - - /isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: true - - /js-sdsl@4.4.0: - resolution: {integrity: sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==} - dev: true - - /js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - dependencies: - argparse: 2.0.1 - dev: true - - /json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - dev: true - - /json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - dev: true - - /jszip@3.10.1: - resolution: {integrity: sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==} - dependencies: - lie: 3.3.0 - pako: 1.0.11 - readable-stream: 2.3.8 - setimmediate: 1.0.5 - dev: true - - /levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - dev: true - - /lie@3.3.0: - resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} - dependencies: - immediate: 3.0.6 - dev: true - - /locate-path@6.0.0: - resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} - engines: {node: '>=10'} - dependencies: - p-locate: 5.0.0 - dev: true - - /lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - dev: true - - /log-symbols@4.1.0: - resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} - engines: {node: '>=10'} - dependencies: - chalk: 4.1.2 - is-unicode-supported: 0.1.0 - dev: true - - /lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - dependencies: - yallist: 4.0.0 - dev: true - - /merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - dev: true - - /micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - dev: true - - /minimatch@3.1.2: - resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} - dependencies: - brace-expansion: 1.1.11 - dev: true - - /minimatch@5.0.1: - resolution: {integrity: sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: true - - /minimatch@5.1.6: - resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} - engines: {node: '>=10'} - dependencies: - brace-expansion: 2.0.1 - dev: true - - /mocha@10.2.0: - resolution: {integrity: sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==} - engines: {node: '>= 14.0.0'} - hasBin: true - dependencies: - ansi-colors: 4.1.1 - browser-stdout: 1.3.1 - chokidar: 3.5.3 - debug: 4.3.4(supports-color@8.1.1) - diff: 5.0.0 - escape-string-regexp: 4.0.0 - find-up: 5.0.0 - glob: 7.2.0 - he: 1.2.0 - js-yaml: 4.1.0 - log-symbols: 4.1.0 - minimatch: 5.0.1 - ms: 2.1.3 - nanoid: 3.3.3 - serialize-javascript: 6.0.0 - strip-json-comments: 3.1.1 - supports-color: 8.1.1 - workerpool: 6.2.1 - yargs: 16.2.0 - yargs-parser: 20.2.4 - yargs-unparser: 2.0.0 - dev: true - - /ms@2.1.2: - resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} - dev: true - - /ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - dev: true - - /nanoid@3.3.3: - resolution: {integrity: sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - dev: true - - /natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - dev: true - - /natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - dev: true - - /normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - dev: true - - /once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - dependencies: - wrappy: 1.0.2 - dev: true - - /optionator@0.9.1: - resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} - engines: {node: '>= 0.8.0'} - dependencies: - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - word-wrap: 1.2.3 - dev: true - - /p-limit@3.1.0: - resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} - engines: {node: '>=10'} - dependencies: - yocto-queue: 0.1.0 - dev: true - - /p-locate@5.0.0: - resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} - engines: {node: '>=10'} - dependencies: - p-limit: 3.1.0 - dev: true - - /pako@1.0.11: - resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} - dev: true - - /parent-module@1.0.1: - resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} - engines: {node: '>=6'} - dependencies: - callsites: 3.1.0 - dev: true - - /path-exists@4.0.0: - resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} - engines: {node: '>=8'} - dev: true - - /path-is-absolute@1.0.1: - resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} - engines: {node: '>=0.10.0'} - dev: true - - /path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - dev: true - - /path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - dev: true - - /picomatch@2.3.1: - resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} - engines: {node: '>=8.6'} - dev: true - - /prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - dev: true - - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} - hasBin: true - dev: true - - /process-nextick-args@2.0.1: - resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - dev: true - - /punycode@2.3.0: - resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} - engines: {node: '>=6'} - dev: true - - /queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - dev: true - - /randombytes@2.1.0: - resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} - dependencies: - safe-buffer: 5.2.1 - dev: true - - /readable-stream@2.3.8: - resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} - dependencies: - core-util-is: 1.0.3 - inherits: 2.0.4 - isarray: 1.0.0 - process-nextick-args: 2.0.1 - safe-buffer: 5.1.2 - string_decoder: 1.1.1 - util-deprecate: 1.0.2 - dev: true - - /readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} - dependencies: - picomatch: 2.3.1 - dev: true - - /require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - dev: true - - /resolve-from@4.0.0: - resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} - engines: {node: '>=4'} - dev: true - - /reusify@1.0.4: - resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: true - - /rimraf@3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - dependencies: - glob: 7.2.0 - dev: true - - /run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - dependencies: - queue-microtask: 1.2.3 - dev: true - - /safe-buffer@5.1.2: - resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - dev: true - - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: true - - /semver@7.5.1: - resolution: {integrity: sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==} - engines: {node: '>=10'} - hasBin: true - dependencies: - lru-cache: 6.0.0 - dev: true - - /serialize-javascript@6.0.0: - resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} - dependencies: - randombytes: 2.1.0 - dev: true - - /setimmediate@1.0.5: - resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} - dev: true - - /shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - dependencies: - shebang-regex: 3.0.0 - dev: true - - /shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - dev: true - - /slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - dev: true - - /string-width@4.2.3: - resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} - engines: {node: '>=8'} - dependencies: - emoji-regex: 8.0.0 - is-fullwidth-code-point: 3.0.0 - strip-ansi: 6.0.1 - dev: true - - /string_decoder@1.1.1: - resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} - dependencies: - safe-buffer: 5.1.2 - dev: true - - /strip-ansi@6.0.1: - resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} - engines: {node: '>=8'} - dependencies: - ansi-regex: 5.0.1 - dev: true - - /strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - dev: true - - /supports-color@7.2.0: - resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} - engines: {node: '>=8'} - dependencies: - has-flag: 4.0.0 - dev: true - - /supports-color@8.1.1: - resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} - engines: {node: '>=10'} - dependencies: - has-flag: 4.0.0 - dev: true - - /text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - dev: true - - /to-regex-range@5.0.1: - resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} - engines: {node: '>=8.0'} - dependencies: - is-number: 7.0.0 - dev: true - - /toml@3.0.0: - resolution: {integrity: sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==} - dev: false - - /tslib@1.14.1: - resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} - dev: true - - /tsutils@3.21.0(typescript@5.0.4): - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - dependencies: - tslib: 1.14.1 - typescript: 5.0.4 - dev: true - - /type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - dependencies: - prelude-ls: 1.2.1 - dev: true - - /type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - dev: true - - /typescript@5.0.4: - resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} - engines: {node: '>=12.20'} - hasBin: true - dev: true - - /uri-js@4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} - dependencies: - punycode: 2.3.0 - dev: true - - /util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: true - - /which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - dependencies: - isexe: 2.0.0 - dev: true - - /word-wrap@1.2.3: - resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} - engines: {node: '>=0.10.0'} - dev: true - - /workerpool@6.2.1: - resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} - dev: true - - /wrap-ansi@7.0.0: - resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} - engines: {node: '>=10'} - dependencies: - ansi-styles: 4.3.0 - string-width: 4.2.3 - strip-ansi: 6.0.1 - dev: true - - /wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - dev: true - - /y18n@5.0.8: - resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} - engines: {node: '>=10'} - dev: true - - /yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - dev: true - - /yargs-parser@20.2.4: - resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} - engines: {node: '>=10'} - dev: true - - /yargs-unparser@2.0.0: - resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} - engines: {node: '>=10'} - dependencies: - camelcase: 6.3.0 - decamelize: 4.0.0 - flat: 5.0.2 - is-plain-obj: 2.1.0 - dev: true - - /yargs@16.2.0: - resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} - engines: {node: '>=10'} - dependencies: - cliui: 7.0.4 - escalade: 3.1.1 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - string-width: 4.2.3 - y18n: 5.0.8 - yargs-parser: 20.2.4 - dev: true - - /yocto-queue@0.1.0: - resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} - engines: {node: '>=10'} - dev: true diff --git a/apps/scout-extension/src/extension.ts b/apps/scout-extension/src/extension.ts deleted file mode 100644 index adee6f04..00000000 --- a/apps/scout-extension/src/extension.ts +++ /dev/null @@ -1,85 +0,0 @@ -import * as vscode from "vscode"; -import commandExists from "command-exists"; -import toml from "toml"; -import fs from "fs"; -import path from "path"; - -const RUST_ANALYZER_CONFIG = "rust-analyzer.check.overrideCommand"; - -export async function activate(_context: vscode.ExtensionContext) { - // Check workspace is an soroban project - if (!isProjectSoroban()) return; - - const config = vscode.workspace.getConfiguration(); - - // Check rust-analyzer is installed - if (!config.has(RUST_ANALYZER_CONFIG)) { - console.error("rust-analyzer is not installed"); - await vscode.window.showErrorMessage( - "rust-analyzer must be installed in order for scout to work" - ); - } - - // Check scout is installed - try { - await commandExists("cargo-scout-audit"); - } catch (err) { - console.error("cargo-scout-audit is not installed"); - await vscode.window.showErrorMessage( - "cargo-scout-audit must be installed in order for scout to work" - ); - return; - } - - // Update settings to change rust-analyzer config - await config.update(RUST_ANALYZER_CONFIG, [ - "cargo", - "scout-audit", - "--", - "--message-format=json", - ]); -} - -export function deactivate() { - // unused -} - -function isProjectSoroban(): boolean { - const workspaceFolders = vscode.workspace.workspaceFolders; - if (!workspaceFolders) { - console.log("No workspace is opened."); - return false; - } - - // Get the path of the first workspace folder - const cargoTomlPath = path.join(workspaceFolders[0].uri.fsPath, "Cargo.toml"); - if (!fs.existsSync(cargoTomlPath)) { - console.log("Cargo.toml does not exist in the workspace root."); - return false; - } - - // Read and parse the Cargo.toml file - const cargoToml = fs.readFileSync(cargoTomlPath, "utf-8"); - let cargoTomlParsed; - try { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - cargoTomlParsed = toml.parse(cargoToml); - } catch (error) { - console.error("Error parsing Cargo.toml:", error); - return false; - } - - // Check if soroban-sdk is a direct dependency - if ( - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - !cargoTomlParsed.dependencies || - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - !cargoTomlParsed.dependencies["soroban-sdk"] - ) { - console.log("soroban-sdk crate is not a direct dependency in Cargo.toml."); - return false; - } - - console.log("soroban-sdk crate is a direct dependency in Cargo.toml.") - return true; -} diff --git a/apps/scout-extension/src/test/runTest.ts b/apps/scout-extension/src/test/runTest.ts deleted file mode 100644 index 80111913..00000000 --- a/apps/scout-extension/src/test/runTest.ts +++ /dev/null @@ -1,26 +0,0 @@ -import * as path from "path"; - -import { runTests } from "@vscode/test-electron"; - -async function main() { - try { - // The folder containing the Extension Manifest package.json - // Passed to `--extensionDevelopmentPath` - const extensionDevelopmentPath = path.resolve(__dirname, "../../"); - - // The path to test runner - // Passed to --extensionTestsPath - const extensionTestsPath = path.resolve(__dirname, "./suite/index"); - - // Download VS Code, unzip it and run the integration test - await runTests({ extensionDevelopmentPath, extensionTestsPath }); - } catch (err) { - console.error("Failed to run tests", err); - process.exit(1); - } -} - -main().catch((err) => { - console.error(err); - process.exit(1); -}); diff --git a/apps/scout-extension/src/test/suite/extension.test.ts b/apps/scout-extension/src/test/suite/extension.test.ts deleted file mode 100644 index eb6dc2c4..00000000 --- a/apps/scout-extension/src/test/suite/extension.test.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as assert from "assert"; - -// You can import and use all API from the 'vscode' module -// as well as import your extension to test it -import * as vscode from "vscode"; -// import * as myExtension from '../../extension'; - -suite("Extension Test Suite", () => { - void vscode.window.showInformationMessage("Start all tests."); - - test("Sample test", () => { - assert.strictEqual(-1, [1, 2, 3].indexOf(5)); - assert.strictEqual(-1, [1, 2, 3].indexOf(0)); - }); -}); diff --git a/apps/scout-extension/src/test/suite/index.ts b/apps/scout-extension/src/test/suite/index.ts deleted file mode 100644 index 07c757ca..00000000 --- a/apps/scout-extension/src/test/suite/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -import path from "path"; -import Mocha from "mocha"; -import glob from "glob"; - -export function run(): Promise { - // Create the mocha test - const mocha = new Mocha({ - ui: "tdd", - color: true, - }); - - const testsRoot = path.resolve(__dirname, ".."); - - return new Promise((c, e) => { - glob("**/**.test.js", { cwd: testsRoot }, (err, files) => { - if (err) { - return e(err); - } - - // Add files to the test suite - files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f))); - - try { - // Run the mocha test - mocha.run((failures) => { - if (failures > 0) { - e(new Error(`${failures} tests failed.`)); - } else { - c(); - } - }); - } catch (err) { - console.error(err); - e(err); - } - }); - }); -} diff --git a/apps/scout-extension/tsconfig.json b/apps/scout-extension/tsconfig.json deleted file mode 100644 index 7c0f8c19..00000000 --- a/apps/scout-extension/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "ES2020", - "outDir": "out", - "lib": [ - "ES2020" - ], - "sourceMap": true, - "rootDir": "src", - "strict": true /* enable all strict type-checking options */, - "esModuleInterop": true - /* Additional Checks */ - // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ - // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ - // "noUnusedParameters": true, /* Report errors on unused parameters. */ - } -} diff --git a/scout-audit-clippy-utils/Cargo.lock b/scout-audit-clippy-utils/Cargo.lock deleted file mode 100644 index b3fddfea..00000000 --- a/scout-audit-clippy-utils/Cargo.lock +++ /dev/null @@ -1,46 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "if_chain" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "rustc-semver" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be1bdc7edf596692617627bbfeaba522131b18e06ca4df2b6b689e3c5d5ce84" - -[[package]] -name = "scout-audit-clippy-utils" -version = "0.2.0" -dependencies = [ - "arrayvec", - "if_chain", - "itertools", - "rustc-semver", -] diff --git a/scout-audit-clippy-utils/Cargo.toml b/scout-audit-clippy-utils/Cargo.toml deleted file mode 100644 index 149d6772..00000000 --- a/scout-audit-clippy-utils/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "scout-audit-clippy-utils" -version = "0.2.1" -edition = "2021" -license = "MIT" -repository = "https://github.com/rust-lang/rust-clippy" -description = "For internal usage by cargo-scout-audit." - -[dependencies] -arrayvec = { version = "0.7", default-features = false } -if_chain = "1.0" -itertools = "0.10.1" -rustc-semver = "1.1" - -[features] -deny-warnings = [] -internal = [] - -[package.metadata.rust-analyzer] -# This crate uses #[feature(rustc_private)] -rustc_private = true diff --git a/scout-audit-clippy-utils/README.md b/scout-audit-clippy-utils/README.md deleted file mode 100644 index 8aca32ce..00000000 --- a/scout-audit-clippy-utils/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Scout Audit Clippy Utils - -This crate is a copy of `clippy_utils` crate found on the [rust-clippy](https://github.com/rust-lang/rust-clippy/tree/master) repository. - -This crate is used to allow publishing `scout-audit-internal` to crates.io given `clippy_utils` itself is not published. - -## Version - -Commit `7671c283a50b5d1168841f3014b14000f01dd204`. diff --git a/scout-audit-clippy-utils/rust-toolchain b/scout-audit-clippy-utils/rust-toolchain deleted file mode 100644 index d575da6d..00000000 --- a/scout-audit-clippy-utils/rust-toolchain +++ /dev/null @@ -1,3 +0,0 @@ -[toolchain] -channel = "nightly-2023-12-16" -components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"] diff --git a/scout-audit-clippy-utils/src/ast_utils.rs b/scout-audit-clippy-utils/src/ast_utils.rs deleted file mode 100644 index a78ff020..00000000 --- a/scout-audit-clippy-utils/src/ast_utils.rs +++ /dev/null @@ -1,786 +0,0 @@ -//! Utilities for manipulating and extracting information from `rustc_ast::ast`. -//! -//! - The `eq_foobar` functions test for semantic equality but ignores `NodeId`s and `Span`s. - -#![allow(clippy::similar_names, clippy::wildcard_imports, clippy::enum_glob_use)] - -use crate::{both, over}; -use rustc_ast::ptr::P; -use rustc_ast::{self as ast, *}; -use rustc_span::symbol::Ident; -use std::mem; - -pub mod ident_iter; -pub use ident_iter::IdentIter; - -pub fn is_useless_with_eq_exprs(kind: BinOpKind) -> bool { - use BinOpKind::*; - matches!( - kind, - Sub | Div | Eq | Lt | Le | Gt | Ge | Ne | And | Or | BitXor | BitAnd | BitOr - ) -} - -/// Checks if each element in the first slice is contained within the latter as per `eq_fn`. -pub fn unordered_over(left: &[X], right: &[X], mut eq_fn: impl FnMut(&X, &X) -> bool) -> bool { - left.len() == right.len() && left.iter().all(|l| right.iter().any(|r| eq_fn(l, r))) -} - -pub fn eq_id(l: Ident, r: Ident) -> bool { - l.name == r.name -} - -pub fn eq_pat(l: &Pat, r: &Pat) -> bool { - use PatKind::*; - match (&l.kind, &r.kind) { - (Paren(l), _) => eq_pat(l, r), - (_, Paren(r)) => eq_pat(l, r), - (Wild, Wild) | (Rest, Rest) => true, - (Lit(l), Lit(r)) => eq_expr(l, r), - (Ident(b1, i1, s1), Ident(b2, i2, s2)) => b1 == b2 && eq_id(*i1, *i2) && both(s1, s2, |l, r| eq_pat(l, r)), - (Range(lf, lt, le), Range(rf, rt, re)) => { - eq_expr_opt(lf, rf) && eq_expr_opt(lt, rt) && eq_range_end(&le.node, &re.node) - }, - (Box(l), Box(r)) - | (Ref(l, Mutability::Not), Ref(r, Mutability::Not)) - | (Ref(l, Mutability::Mut), Ref(r, Mutability::Mut)) => eq_pat(l, r), - (Tuple(l), Tuple(r)) | (Slice(l), Slice(r)) => over(l, r, |l, r| eq_pat(l, r)), - (Path(lq, lp), Path(rq, rp)) => both(lq, rq, eq_qself) && eq_path(lp, rp), - (TupleStruct(lqself, lp, lfs), TupleStruct(rqself, rp, rfs)) => { - eq_maybe_qself(lqself, rqself) && eq_path(lp, rp) && over(lfs, rfs, |l, r| eq_pat(l, r)) - }, - (Struct(lqself, lp, lfs, lr), Struct(rqself, rp, rfs, rr)) => { - lr == rr && eq_maybe_qself(lqself, rqself) && eq_path(lp, rp) && unordered_over(lfs, rfs, eq_field_pat) - }, - (Or(ls), Or(rs)) => unordered_over(ls, rs, |l, r| eq_pat(l, r)), - (MacCall(l), MacCall(r)) => eq_mac_call(l, r), - _ => false, - } -} - -pub fn eq_range_end(l: &RangeEnd, r: &RangeEnd) -> bool { - match (l, r) { - (RangeEnd::Excluded, RangeEnd::Excluded) => true, - (RangeEnd::Included(l), RangeEnd::Included(r)) => { - matches!(l, RangeSyntax::DotDotEq) == matches!(r, RangeSyntax::DotDotEq) - }, - _ => false, - } -} - -pub fn eq_field_pat(l: &PatField, r: &PatField) -> bool { - l.is_placeholder == r.is_placeholder - && eq_id(l.ident, r.ident) - && eq_pat(&l.pat, &r.pat) - && over(&l.attrs, &r.attrs, eq_attr) -} - -pub fn eq_qself(l: &P, r: &P) -> bool { - l.position == r.position && eq_ty(&l.ty, &r.ty) -} - -pub fn eq_maybe_qself(l: &Option>, r: &Option>) -> bool { - match (l, r) { - (Some(l), Some(r)) => eq_qself(l, r), - (None, None) => true, - _ => false, - } -} - -pub fn eq_path(l: &Path, r: &Path) -> bool { - over(&l.segments, &r.segments, eq_path_seg) -} - -pub fn eq_path_seg(l: &PathSegment, r: &PathSegment) -> bool { - eq_id(l.ident, r.ident) && both(&l.args, &r.args, |l, r| eq_generic_args(l, r)) -} - -pub fn eq_generic_args(l: &GenericArgs, r: &GenericArgs) -> bool { - match (l, r) { - (GenericArgs::AngleBracketed(l), GenericArgs::AngleBracketed(r)) => over(&l.args, &r.args, eq_angle_arg), - (GenericArgs::Parenthesized(l), GenericArgs::Parenthesized(r)) => { - over(&l.inputs, &r.inputs, |l, r| eq_ty(l, r)) && eq_fn_ret_ty(&l.output, &r.output) - }, - _ => false, - } -} - -pub fn eq_angle_arg(l: &AngleBracketedArg, r: &AngleBracketedArg) -> bool { - match (l, r) { - (AngleBracketedArg::Arg(l), AngleBracketedArg::Arg(r)) => eq_generic_arg(l, r), - (AngleBracketedArg::Constraint(l), AngleBracketedArg::Constraint(r)) => eq_assoc_constraint(l, r), - _ => false, - } -} - -pub fn eq_generic_arg(l: &GenericArg, r: &GenericArg) -> bool { - match (l, r) { - (GenericArg::Lifetime(l), GenericArg::Lifetime(r)) => eq_id(l.ident, r.ident), - (GenericArg::Type(l), GenericArg::Type(r)) => eq_ty(l, r), - (GenericArg::Const(l), GenericArg::Const(r)) => eq_expr(&l.value, &r.value), - _ => false, - } -} - -pub fn eq_expr_opt(l: &Option>, r: &Option>) -> bool { - both(l, r, |l, r| eq_expr(l, r)) -} - -pub fn eq_struct_rest(l: &StructRest, r: &StructRest) -> bool { - match (l, r) { - (StructRest::Base(lb), StructRest::Base(rb)) => eq_expr(lb, rb), - (StructRest::Rest(_), StructRest::Rest(_)) | (StructRest::None, StructRest::None) => true, - _ => false, - } -} - -pub fn eq_expr(l: &Expr, r: &Expr) -> bool { - use ExprKind::*; - if !over(&l.attrs, &r.attrs, eq_attr) { - return false; - } - match (&l.kind, &r.kind) { - (Paren(l), _) => eq_expr(l, r), - (_, Paren(r)) => eq_expr(l, r), - (Err, Err) => true, - (Try(l), Try(r)) | (Await(l, _), Await(r, _)) => eq_expr(l, r), - (Array(l), Array(r)) => over(l, r, |l, r| eq_expr(l, r)), - (Tup(l), Tup(r)) => over(l, r, |l, r| eq_expr(l, r)), - (Repeat(le, ls), Repeat(re, rs)) => eq_expr(le, re) && eq_expr(&ls.value, &rs.value), - (Call(lc, la), Call(rc, ra)) => eq_expr(lc, rc) && over(la, ra, |l, r| eq_expr(l, r)), - ( - MethodCall(box ast::MethodCall { - seg: ls, - receiver: lr, - args: la, - .. - }), - MethodCall(box ast::MethodCall { - seg: rs, - receiver: rr, - args: ra, - .. - }), - ) => eq_path_seg(ls, rs) && eq_expr(lr, rr) && over(la, ra, |l, r| eq_expr(l, r)), - (Binary(lo, ll, lr), Binary(ro, rl, rr)) => lo.node == ro.node && eq_expr(ll, rl) && eq_expr(lr, rr), - (Unary(lo, l), Unary(ro, r)) => mem::discriminant(lo) == mem::discriminant(ro) && eq_expr(l, r), - (Lit(l), Lit(r)) => l == r, - (Cast(l, lt), Cast(r, rt)) | (Type(l, lt), Type(r, rt)) => eq_expr(l, r) && eq_ty(lt, rt), - (Let(lp, le, _, _), Let(rp, re, _, _)) => eq_pat(lp, rp) && eq_expr(le, re), - (If(lc, lt, le), If(rc, rt, re)) => eq_expr(lc, rc) && eq_block(lt, rt) && eq_expr_opt(le, re), - (While(lc, lt, ll), While(rc, rt, rl)) => eq_label(ll, rl) && eq_expr(lc, rc) && eq_block(lt, rt), - (ForLoop(lp, li, lt, ll), ForLoop(rp, ri, rt, rl)) => { - eq_label(ll, rl) && eq_pat(lp, rp) && eq_expr(li, ri) && eq_block(lt, rt) - }, - (Loop(lt, ll, _), Loop(rt, rl, _)) => eq_label(ll, rl) && eq_block(lt, rt), - (Block(lb, ll), Block(rb, rl)) => eq_label(ll, rl) && eq_block(lb, rb), - (TryBlock(l), TryBlock(r)) => eq_block(l, r), - (Yield(l), Yield(r)) | (Ret(l), Ret(r)) => eq_expr_opt(l, r), - (Break(ll, le), Break(rl, re)) => eq_label(ll, rl) && eq_expr_opt(le, re), - (Continue(ll), Continue(rl)) => eq_label(ll, rl), - (Assign(l1, l2, _), Assign(r1, r2, _)) | (Index(l1, l2, _), Index(r1, r2, _)) => { - eq_expr(l1, r1) && eq_expr(l2, r2) - }, - (AssignOp(lo, lp, lv), AssignOp(ro, rp, rv)) => lo.node == ro.node && eq_expr(lp, rp) && eq_expr(lv, rv), - (Field(lp, lf), Field(rp, rf)) => eq_id(*lf, *rf) && eq_expr(lp, rp), - (Match(ls, la), Match(rs, ra)) => eq_expr(ls, rs) && over(la, ra, eq_arm), - ( - Closure(box ast::Closure { - binder: lb, - capture_clause: lc, - asyncness: la, - movability: lm, - fn_decl: lf, - body: le, - .. - }), - Closure(box ast::Closure { - binder: rb, - capture_clause: rc, - asyncness: ra, - movability: rm, - fn_decl: rf, - body: re, - .. - }), - ) => { - eq_closure_binder(lb, rb) - && lc == rc - && la.is_async() == ra.is_async() - && lm == rm - && eq_fn_decl(lf, rf) - && eq_expr(le, re) - }, - (Async(lc, lb), Async(rc, rb)) => lc == rc && eq_block(lb, rb), - (Range(lf, lt, ll), Range(rf, rt, rl)) => ll == rl && eq_expr_opt(lf, rf) && eq_expr_opt(lt, rt), - (AddrOf(lbk, lm, le), AddrOf(rbk, rm, re)) => lbk == rbk && lm == rm && eq_expr(le, re), - (Path(lq, lp), Path(rq, rp)) => both(lq, rq, eq_qself) && eq_path(lp, rp), - (MacCall(l), MacCall(r)) => eq_mac_call(l, r), - (Struct(lse), Struct(rse)) => { - eq_maybe_qself(&lse.qself, &rse.qself) - && eq_path(&lse.path, &rse.path) - && eq_struct_rest(&lse.rest, &rse.rest) - && unordered_over(&lse.fields, &rse.fields, eq_field) - }, - _ => false, - } -} - -pub fn eq_field(l: &ExprField, r: &ExprField) -> bool { - l.is_placeholder == r.is_placeholder - && eq_id(l.ident, r.ident) - && eq_expr(&l.expr, &r.expr) - && over(&l.attrs, &r.attrs, eq_attr) -} - -pub fn eq_arm(l: &Arm, r: &Arm) -> bool { - l.is_placeholder == r.is_placeholder - && eq_pat(&l.pat, &r.pat) - && eq_expr(&l.body, &r.body) - && eq_expr_opt(&l.guard, &r.guard) - && over(&l.attrs, &r.attrs, eq_attr) -} - -pub fn eq_label(l: &Option
    ErrorSpansMessage
    {}
      {}
    {}