From a6eb910dafef1203523ce0820048e64a82a82781 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Wed, 31 Jan 2024 13:12:57 -0500 Subject: [PATCH] ci: run prettier with deno instead of npx (#488) --- .github/workflows/generate-format.yml | 5 +---- deno.json | 3 ++- deno.lock | 5 +++++ scripts/_prettier.ts | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 scripts/_prettier.ts diff --git a/.github/workflows/generate-format.yml b/.github/workflows/generate-format.yml index de3bbf67..c1ef785f 100644 --- a/.github/workflows/generate-format.yml +++ b/.github/workflows/generate-format.yml @@ -43,11 +43,8 @@ jobs: default_author: github_actions push: false - - name: Setup Node.js - uses: actions/setup-node@v4 - - name: Format files - run: npx prettier --write . + run: deno task format - name: Commit changes uses: EndBug/add-and-commit@v9 diff --git a/deno.json b/deno.json index 94d27f30..a3d95ddd 100644 --- a/deno.json +++ b/deno.json @@ -17,7 +17,8 @@ "ci:sync-maintainers": "deno run -A ./scripts/sync-maintainers/main.ts", "lint": "deno run -A ./scripts/lint/main.ts", "lint:fix": "deno task lint --fix", - "update-types": "deno run -A ./scripts/update-types.ts" + "update-types": "deno run -A ./scripts/update-types.ts", + "format": "deno run -A npm:prettier@3.2.4 --write ." }, "nodeModulesDir": true } diff --git a/deno.lock b/deno.lock index b9b8233a..da2f7a9e 100644 --- a/deno.lock +++ b/deno.lock @@ -10,6 +10,7 @@ "npm:json-schema-to-typescript": "npm:json-schema-to-typescript@13.1.1_glob@7.2.3", "npm:less@4.2.0": "npm:less@4.2.0", "npm:postcss-less": "npm:postcss-less@6.0.0_postcss@8.4.32", + "npm:prettier@3.2.4": "npm:prettier@3.2.4", "npm:stylelint": "npm:stylelint@16.0.1_@csstools+css-tokenizer@2.2.1_@csstools+css-parser-algorithms@2.3.2__@csstools+css-tokenizer@2.2.1_postcss-selector-parser@6.0.13_postcss@8.4.32", "npm:stylelint-config-recommended": "npm:stylelint-config-recommended@14.0.0_stylelint@16.0.1__@csstools+css-tokenizer@2.2.1__@csstools+css-parser-algorithms@2.3.2___@csstools+css-tokenizer@2.2.1__postcss-selector-parser@6.0.13__postcss@8.4.32", "npm:stylelint-config-standard": "npm:stylelint-config-standard@35.0.0_stylelint@16.0.1__@csstools+css-tokenizer@2.2.1__@csstools+css-parser-algorithms@2.3.2___@csstools+css-tokenizer@2.2.1__postcss-selector-parser@6.0.13__postcss@8.4.32", @@ -956,6 +957,10 @@ "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dependencies": {} }, + "prettier@3.2.4": { + "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", + "dependencies": {} + }, "prr@1.0.1": { "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==", "dependencies": {} diff --git a/scripts/_prettier.ts b/scripts/_prettier.ts new file mode 100644 index 00000000..f23645d5 --- /dev/null +++ b/scripts/_prettier.ts @@ -0,0 +1 @@ +import "npm:prettier@3.2.4";