From 2386d7fca23e551fc57142edd7b051f7fdd48fd1 Mon Sep 17 00:00:00 2001 From: Boshen Date: Sun, 8 Sep 2024 14:05:46 +0800 Subject: [PATCH] chore(dprint): format yaml files (#5598) --- .github/actions/pnpm/action.yml | 16 +- .github/labeler.yml | 52 +++--- .github/workflows/autofix.yml | 6 +- .github/workflows/benchmark.yml | 164 +++++++++--------- .github/workflows/ci.yml | 18 +- .github/workflows/codecov.yml | 4 +- .github/workflows/link-check.yml | 12 +- .github/workflows/lint-rules.yml | 4 +- .github/workflows/miri.yml | 12 +- .github/workflows/prepare_release_crates.yml | 2 +- .github/workflows/prepare_release_oxlint.yml | 2 +- .github/workflows/release_wasm.yml | 2 +- .../workflows/reusable_prepare_release.yml | 2 +- dprint.json | 8 +- 14 files changed, 153 insertions(+), 151 deletions(-) diff --git a/.github/actions/pnpm/action.yml b/.github/actions/pnpm/action.yml index 8adfca2398a3b..1c205c745024e 100644 --- a/.github/actions/pnpm/action.yml +++ b/.github/actions/pnpm/action.yml @@ -3,13 +3,13 @@ name: pnpm runs: using: composite steps: - - uses: pnpm/action-setup@v4.0.0 + - uses: pnpm/action-setup@v4.0.0 - - uses: actions/setup-node@v4 - with: - node-version-file: .node-version - registry-url: 'https://registry.npmjs.org' - cache: pnpm + - uses: actions/setup-node@v4 + with: + node-version-file: .node-version + registry-url: "https://registry.npmjs.org" + cache: pnpm - - run: pnpm install --frozen-lockfile - shell: bash + - run: pnpm install --frozen-lockfile + shell: bash diff --git a/.github/labeler.yml b/.github/labeler.yml index 1b486dd73e5c3..7d3d7490356c2 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,51 +1,51 @@ A-ast: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_ast/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_ast/**"] A-ast-tools: -- changed-files: - - any-glob-to-any-file: ['tasks/ast_tools/**'] + - changed-files: + - any-glob-to-any-file: ["tasks/ast_tools/**"] A-cfg: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_cfg/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_cfg/**"] A-cli: -- changed-files: - - any-glob-to-any-file: ['apps/oxlint/**'] + - changed-files: + - any-glob-to-any-file: ["apps/oxlint/**"] A-prettier: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_prettier/**', 'tasks/prettier_conformance/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_prettier/**", "tasks/prettier_conformance/**"] A-transformer: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_transformer/**', 'tasks/transform_conformance/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_transformer/**", "tasks/transform_conformance/**"] A-linter: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_linter/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_linter/**"] A-minifier: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_minifier/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_minifier/**"] A-parser: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_parser/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_parser/**"] A-codegen: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_codegen/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_codegen/**"] A-semantic: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_semantic/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_semantic/**"] A-type-checking: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_type_synthesis/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_type_synthesis/**"] A-isolated-declarations: -- changed-files: - - any-glob-to-any-file: ['crates/oxc_isolated_declarations/**'] + - changed-files: + - any-glob-to-any-file: ["crates/oxc_isolated_declarations/**"] diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 17096082b9e47..88f7426c9b401 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -4,10 +4,8 @@ on: pull_request: types: [opened, synchronize] paths-ignore: - - '**/*.md' - - '**/*.yml' - - '!.github/workflows/ci.yml' - - '!.github/actions/clone-submodules/action.yml' + - "!.github/workflows/ci.yml" + - "!.github/actions/clone-submodules/action.yml" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index c63bc3d90a785..0f22817fafbd0 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -18,24 +18,24 @@ on: pull_request: types: [opened, synchronize] paths: - - '**/*.rs' - - 'napi/parser/**/*.js' - - 'napi/parser/**/*.mjs' - - 'Cargo.lock' - - 'rust-toolchain.toml' - - '.github/workflows/benchmark.yml' - - 'tasks/benchmark/codspeed/*.mjs' + - "**/*.rs" + - "napi/parser/**/*.js" + - "napi/parser/**/*.mjs" + - "Cargo.lock" + - "rust-toolchain.toml" + - ".github/workflows/benchmark.yml" + - "tasks/benchmark/codspeed/*.mjs" push: branches: - main paths: - - '**/*.rs' - - 'napi/parser/**/*.js' - - 'napi/parser/**/*.mjs' - - 'Cargo.lock' - - 'rust-toolchain.toml' - - '.github/workflows/benchmark.yml' - - 'tasks/benchmark/codspeed/*.mjs' + - "**/*.rs" + - "napi/parser/**/*.js" + - "napi/parser/**/*.mjs" + - "Cargo.lock" + - "rust-toolchain.toml" + - ".github/workflows/benchmark.yml" + - "tasks/benchmark/codspeed/*.mjs" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} @@ -205,74 +205,74 @@ jobs: retention-days: 1 # benchmark-napi: - # name: Benchmark NAPI parser - # runs-on: ubuntu-latest - # if: false - # steps: - # - name: Checkout Branch - # uses: taiki-e/checkout-action@v1 - - # - uses: Boshen/setup-rust@main - # with: - # shared-key: benchmark_napi - # save-cache: ${{ github.ref_name == 'main' }} - - # - name: Install codspeed - # uses: taiki-e/install-action@v2 - # with: - # tool: cargo-codspeed - - # - uses: ./.github/actions/pnpm - - # - name: Start bench results interceptor server - # working-directory: ./tasks/benchmark/codspeed - # env: - # COMPONENT: 'parser_napi' - # run: | - # pnpm install - # node capture.mjs & - - # # CodSpeed gets measurements completely off for NAPI if run in `CodSpeedHQ/action`, - # # so instead run real benchmark without CodSpeed's instrumentation and save the results. - # # Then "Run Rust benchmark" step below runs a loop of some simple Rust code the number - # # of times required to take same amount of time as the real benchmark took. - # # This is all a workaround for https://github.com/CodSpeedHQ/action/issues/96 - # - name: Build NAPI Benchmark - # working-directory: ./napi/parser - # run: | - # corepack enable - # pnpm install - # pnpm build - - # - name: Run NAPI Benchmark - # working-directory: ./napi/parser - # run: node parse.bench.mjs - - # - name: Build Rust benchmark - # env: - # RUSTFLAGS: "-C debuginfo=2 -C strip=none -g --cfg codspeed" - # run: | - # cargo build --release -p oxc_benchmark --bench parser_napi --no-default-features --features codspeed_napi - # mkdir -p target/codspeed/oxc_benchmark/ - # mv target/release/deps/parser_napi-* target/codspeed/oxc_benchmark - # rm -rf target/codspeed/oxc_benchmark/*.d - - # - name: Run Rust benchmark - # uses: CodSpeedHQ/action@v2 - # timeout-minutes: 30 - # with: - # run: cargo codspeed run - # # Dummy token for tokenless runs, to suppress logging hash of metadata JSON (see `upload.mjs`) - # token: ${{ secrets.CODSPEED_TOKEN || 'dummy' }} - # upload-url: http://localhost:${{ env.INTERCEPT_PORT }}/upload - - # - name: Upload bench data artefact - # uses: actions/upload-artifact@v4 - # with: - # name: 'parser_napi' - # path: ${{ env.DATA_DIR }} - # if-no-files-found: error - # retention-days: 1 + # name: Benchmark NAPI parser + # runs-on: ubuntu-latest + # if: false + # steps: + # - name: Checkout Branch + # uses: taiki-e/checkout-action@v1 + + # - uses: Boshen/setup-rust@main + # with: + # shared-key: benchmark_napi + # save-cache: ${{ github.ref_name == 'main' }} + + # - name: Install codspeed + # uses: taiki-e/install-action@v2 + # with: + # tool: cargo-codspeed + + # - uses: ./.github/actions/pnpm + + # - name: Start bench results interceptor server + # working-directory: ./tasks/benchmark/codspeed + # env: + # COMPONENT: 'parser_napi' + # run: | + # pnpm install + # node capture.mjs & + + # # CodSpeed gets measurements completely off for NAPI if run in `CodSpeedHQ/action`, + # # so instead run real benchmark without CodSpeed's instrumentation and save the results. + # # Then "Run Rust benchmark" step below runs a loop of some simple Rust code the number + # # of times required to take same amount of time as the real benchmark took. + # # This is all a workaround for https://github.com/CodSpeedHQ/action/issues/96 + # - name: Build NAPI Benchmark + # working-directory: ./napi/parser + # run: | + # corepack enable + # pnpm install + # pnpm build + + # - name: Run NAPI Benchmark + # working-directory: ./napi/parser + # run: node parse.bench.mjs + + # - name: Build Rust benchmark + # env: + # RUSTFLAGS: "-C debuginfo=2 -C strip=none -g --cfg codspeed" + # run: | + # cargo build --release -p oxc_benchmark --bench parser_napi --no-default-features --features codspeed_napi + # mkdir -p target/codspeed/oxc_benchmark/ + # mv target/release/deps/parser_napi-* target/codspeed/oxc_benchmark + # rm -rf target/codspeed/oxc_benchmark/*.d + + # - name: Run Rust benchmark + # uses: CodSpeedHQ/action@v2 + # timeout-minutes: 30 + # with: + # run: cargo codspeed run + # # Dummy token for tokenless runs, to suppress logging hash of metadata JSON (see `upload.mjs`) + # token: ${{ secrets.CODSPEED_TOKEN || 'dummy' }} + # upload-url: http://localhost:${{ env.INTERCEPT_PORT }}/upload + + # - name: Upload bench data artefact + # uses: actions/upload-artifact@v4 + # with: + # name: 'parser_napi' + # path: ${{ env.DATA_DIR }} + # if-no-files-found: error + # retention-days: 1 # Upload combined benchmark results to CodSpeed upload: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fe78b983c311..61cc5a0505061 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,19 +5,19 @@ on: pull_request: types: [opened, synchronize] paths-ignore: - - '**/*.md' - - '**/*.yml' - - '!.github/workflows/ci.yml' - - '!.github/actions/clone-submodules/action.yml' + - "**/*.md" + - "**/*.yml" + - "!.github/workflows/ci.yml" + - "!.github/actions/clone-submodules/action.yml" push: branches: - main - "renovate/**" paths-ignore: - - '**/*.md' - - '**/*.yml' - - '!.github/workflows/ci.yml' - - '!.github/actions/clone-submodules/action.yml' + - "**/*.md" + - "**/*.yml" + - "!.github/workflows/ci.yml" + - "!.github/actions/clone-submodules/action.yml" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} @@ -235,7 +235,7 @@ jobs: - uses: dorny/paths-filter@v3 id: filter with: - filters: '.github/.generated_ast_watch_list.yml' + filters: ".github/.generated_ast_watch_list.yml" - uses: Boshen/setup-rust@main if: steps.filter.outputs.src == 'true' diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index ede4813035413..db92ce669dc1e 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -8,8 +8,8 @@ on: branches: - main paths: - - '**.rs' - - '.github/workflows/codecov.yml' + - "**.rs" + - ".github/workflows/codecov.yml" concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 39c0892990f81..fba9877aee64f 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -6,15 +6,15 @@ on: branches: - main paths: - - '**/*.md' - - '**/*.html' - - '!**/fixtures/**' + - "**/*.md" + - "**/*.html" + - "!**/fixtures/**" pull_request: types: [opened, synchronize] paths: - - '**/*.md' - - '**/*.html' - - '!**/fixtures/**' + - "**/*.md" + - "**/*.html" + - "!**/fixtures/**" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/.github/workflows/lint-rules.yml b/.github/workflows/lint-rules.yml index a3c3cf83c6565..6baca9bbc8c69 100644 --- a/.github/workflows/lint-rules.yml +++ b/.github/workflows/lint-rules.yml @@ -5,8 +5,8 @@ on: branches: - main paths: - - 'crates/oxc_linter/src/rules.rs' - - 'tasks/lint_rules/**' + - "crates/oxc_linter/src/rules.rs" + - "tasks/lint_rules/**" jobs: lint_rules: diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml index 8d96cda0513a4..4ac40046df9bf 100644 --- a/.github/workflows/miri.yml +++ b/.github/workflows/miri.yml @@ -5,16 +5,16 @@ on: pull_request: types: [opened, synchronize] paths: - - 'crates/oxc_parser/**' - - 'crates/oxc_allocator/**' - - '.github/workflows/miri.yml' + - "crates/oxc_parser/**" + - "crates/oxc_allocator/**" + - ".github/workflows/miri.yml" push: branches: - main paths: - - 'crates/oxc_parser/**' - - 'crates/oxc_allocator/**' - - '.github/workflows/miri.yml' + - "crates/oxc_parser/**" + - "crates/oxc_allocator/**" + - ".github/workflows/miri.yml" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} diff --git a/.github/workflows/prepare_release_crates.yml b/.github/workflows/prepare_release_crates.yml index 0c54922623f13..66fb0857e9876 100644 --- a/.github/workflows/prepare_release_crates.yml +++ b/.github/workflows/prepare_release_crates.yml @@ -27,4 +27,4 @@ jobs: with: name: crates secrets: - OXC_BOT_PAT : ${{ secrets.OXC_BOT_PAT }} + OXC_BOT_PAT: ${{ secrets.OXC_BOT_PAT }} diff --git a/.github/workflows/prepare_release_oxlint.yml b/.github/workflows/prepare_release_oxlint.yml index 15ba1c0556a44..07cbdb64ee62b 100644 --- a/.github/workflows/prepare_release_oxlint.yml +++ b/.github/workflows/prepare_release_oxlint.yml @@ -22,7 +22,7 @@ jobs: with: name: oxlint secrets: - OXC_BOT_PAT : ${{ secrets.OXC_BOT_PAT }} + OXC_BOT_PAT: ${{ secrets.OXC_BOT_PAT }} ecosystem-ci: needs: prepare diff --git a/.github/workflows/release_wasm.yml b/.github/workflows/release_wasm.yml index 0375f076ce996..efc6232b80bb5 100644 --- a/.github/workflows/release_wasm.yml +++ b/.github/workflows/release_wasm.yml @@ -49,7 +49,7 @@ jobs: - uses: Boshen/setup-rust@main with: - cache-key: 'wasm' + cache-key: "wasm" - name: Build working-directory: wasm/parser diff --git a/.github/workflows/reusable_prepare_release.yml b/.github/workflows/reusable_prepare_release.yml index 2ad4ca45f8431..93187a2bb342b 100644 --- a/.github/workflows/reusable_prepare_release.yml +++ b/.github/workflows/reusable_prepare_release.yml @@ -8,7 +8,7 @@ on: type: string description: "The name defined in oxc_release.toml" secrets: - OXC_BOT_PAT : + OXC_BOT_PAT: required: true outputs: pull-request-number: diff --git a/dprint.json b/dprint.json index 250938c8a48f8..96db89a245e72 100644 --- a/dprint.json +++ b/dprint.json @@ -14,12 +14,16 @@ "**/fixtures/**", "**/*.snap.*", "**/CHANGELOG.md", + "pnpm-workspace.yaml", + "pnpm-lock.yaml", "napi/{parser,transform}/index.js", - "napi/{parser,transform}/index.d.ts" + "napi/{parser,transform}/index.d.ts", + ".github/.generated_ast_watch_list.yml" ], "plugins": [ "https://plugins.dprint.dev/typescript-0.91.8.wasm", "https://plugins.dprint.dev/json-0.19.3.wasm", - "https://plugins.dprint.dev/markdown-0.17.8.wasm" + "https://plugins.dprint.dev/markdown-0.17.8.wasm", + "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.0.wasm" ] }