From 36a52ba3e142df6f965f8e62cdb47ccd146ebce0 Mon Sep 17 00:00:00 2001 From: Carlos Alejandro Gutierrez Sandoval Date: Wed, 18 Oct 2023 14:29:08 -0600 Subject: [PATCH] fmt --- .github/workflows/pull-request.yml | 87 +++++++++++++++--------------- Makefile.toml | 64 +++++++++++----------- 2 files changed, 76 insertions(+), 75 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 6d7ba251..9744b9b2 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -3,10 +3,10 @@ name: Pull Request on: pull_request: branches: "main" - paths-ignore: ['**.md'] + paths-ignore: ["**.md"] push: branches: "main" - paths-ignore: ['**.md'] + paths-ignore: ["**.md"] env: CARGO_TERM_COLOR: always @@ -15,62 +15,62 @@ jobs: generate-lockfile: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo generate-lockfile -v - - uses: actions/upload-artifact@v3 - with: - name: Cargo.lock - path: Cargo.lock + - uses: actions/checkout@v3 + - name: Build + run: cargo generate-lockfile -v + - uses: actions/upload-artifact@v3 + with: + name: Cargo.lock + path: Cargo.lock linter: needs: generate-lockfile runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - with: - name: Cargo.lock + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: Cargo.lock - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - components: rustfmt, clippy + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: rustfmt, clippy - - uses: davidB/rust-cargo-make@v1 - with: - version: "0.36.13" + - uses: davidB/rust-cargo-make@v1 + with: + version: "0.36.13" - - name: Lint - run: cargo make --profile github-actions format + - name: Lint + run: cargo make --profile github-actions format coverage: needs: clarinet runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - with: - name: Cargo.lock + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 + with: + name: Cargo.lock - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true - - uses: davidB/rust-cargo-make@v1 - with: - version: "0.36.13" + - uses: davidB/rust-cargo-make@v1 + with: + version: "0.36.13" - - name: Coverage - run: cargo make --profile github-actions coverage-lcov + - name: Coverage + run: cargo make --profile github-actions coverage-lcov - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: ./coverage/lcov.info - fail_ci_if_error: true + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: ./coverage/lcov.info + fail_ci_if_error: true clarinet: needs: linter @@ -139,11 +139,10 @@ jobs: - name: Use Node uses: actions/setup-node@v3 with: - node-version: '20' - cache: 'npm' + node-version: "20" + cache: "npm" cache-dependency-path: ./romeo/asset-contract/package-lock.json - run: npm ci working-directory: ./romeo/asset-contract - run: npm run test working-directory: ./romeo/asset-contract - diff --git a/Makefile.toml b/Makefile.toml index 643c1cf1..44da538e 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -28,15 +28,24 @@ TEST_FRAMEWORK = "nextest" [tasks._install-test-framework] private = true condition = { env = { "TEST_FRAMEWORK" = "nextest" } } -install_crate = { crate_name = "cargo-nextest", version = "0.9.57", binary = "cargo", "test_arg" = ["nextest" , "--help"]} +install_crate = { crate_name = "cargo-nextest", version = "0.9.57", binary = "cargo", "test_arg" = [ + "nextest", + "--help", +] } [tasks._install-llvm-cov] private = true -install_crate = { crate_name = "cargo-llvm-cov", version = "0.5.25", binary = "cargo", "test_arg" = ["llvm-cov" , "--help"]} +install_crate = { crate_name = "cargo-llvm-cov", version = "0.5.25", binary = "cargo", "test_arg" = [ + "llvm-cov", + "--help", +] } [tasks._install-audit] private = true -install_crate = { crate_name = "cargo-audit", version = "0.18.1", binary = "cargo", "test_arg" = ["audit" , "--help"]} +install_crate = { crate_name = "cargo-audit", version = "0.18.1", binary = "cargo", "test_arg" = [ + "audit", + "--help", +] } [tasks.install] dependencies = [ @@ -49,14 +58,24 @@ dependencies = [ # ----------- [tasks.format-fmt] -install_crate = "rustfmt" # uses the stable version. +# uses the stable version. +install_crate = "rustfmt" command = "cargo" args = ["fmt", "--check", "--verbose"] [tasks.format-clippy] install_crate = "clippy" # uses the stable version. command = "cargo" -args = ["clippy","--all-features", "--all-targets", "--", "-D", "warnings", "-W", "clippy::all"] +args = [ + "clippy", + "--all-features", + "--all-targets", + "--", + "-D", + "warnings", + "-W", + "clippy::all", +] [tasks.format] dependencies = ["format-clippy", "format-fmt"] @@ -77,10 +96,7 @@ args = ["-p", "${COVERAGE_DIRECTORY}"] [tasks._calculate-coverage] private = true -dependencies = [ - "_install-llvm-cov", - "_install-test-framework", -] +dependencies = ["_install-llvm-cov", "_install-test-framework"] command = "cargo" args = [ "llvm-cov", @@ -99,37 +115,27 @@ args = ["llvm-cov", "clean"] # Public tasks ---------------------------------------------------------------- [tasks.coverage-clean] workspace = false -dependencies = [ "_calculated-coverage-clean", "_coverage-output-clean" ] +dependencies = ["_calculated-coverage-clean", "_coverage-output-clean"] [tasks.coverage-lcov] workspace = false dependencies = [ "_install-llvm-cov", "_calculate-coverage", - "_make-coverage-output-directory" + "_make-coverage-output-directory", ] command = "cargo" -args = [ - "llvm-cov", - "report", - "--output-path=${COVERAGE_LCOV}", - "--lcov", -] +args = ["llvm-cov", "report", "--output-path=${COVERAGE_LCOV}", "--lcov"] [tasks.coverage-html] workspace = false dependencies = [ "_install-llvm-cov", "_calculate-coverage", - "_make-coverage-output-directory" + "_make-coverage-output-directory", ] command = "cargo" -args = [ - "llvm-cov", - "report", - "--output-dir=${COVERAGE_HTML_DIR}", - "--html", -] +args = ["llvm-cov", "report", "--output-dir=${COVERAGE_HTML_DIR}", "--html"] [tasks.coverage-all] workspace = false @@ -164,7 +170,8 @@ args = ["doc"] # ------ [tasks.audit] -workspace = false # Audit must run in workspace root. +# Audit must run in workspace root. +workspace = false dependencies = ["_install-audit"] command = "cargo" args = ["audit", "-D", "warnings"] @@ -176,12 +183,7 @@ args = ["audit", "-D", "warnings"] dependencies = ["coverage-clean", "cargo-clean"] [tasks.pr-validation] -dependencies = [ - "clean", - "format", - "coverage", - "release", -] +dependencies = ["clean", "format", "coverage", "release"] [tasks.default] run_task = "pr-validation"