From 5e6e75bc6e754f5451b99ca0133025c222790dc3 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 7 Jul 2024 16:41:58 +0900 Subject: [PATCH] Replace yamlfmt with pretty_yaml --- .github/workflows/lint.yml | 13 ------------- .vscode/extensions.json | 1 - .vscode/settings.json | 6 ------ dprint.json | 4 +++- flake.nix | 1 - package.json | 4 ++-- yamlfmt.yml | 7 ------- 7 files changed, 5 insertions(+), 31 deletions(-) delete mode 100644 yamlfmt.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1dfaee2f..72e820a4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,7 +3,6 @@ on: push: branches: [main] pull_request: - jobs: dprint: timeout-minutes: 15 @@ -13,7 +12,6 @@ jobs: - uses: dprint/check@v2.2 with: dprint-version: '0.45.1' # selfup { "extract": "\\d[^']+", "replacer": ["dprint", "--version"], "nth": 2 } - typos: timeout-minutes: 15 runs-on: ubuntu-24.04 @@ -26,14 +24,3 @@ jobs: . .github .vscode - - yamlfmt: - timeout-minutes: 15 - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - - name: Install yamlfmt - run: go install github.com/google/yamlfmt/cmd/yamlfmt@v0.12.1 # TODO: Apply selfup after https://github.com/google/yamlfmt/pull/180 - - run: yamlfmt -lint . diff --git a/.vscode/extensions.json b/.vscode/extensions.json index e5e2a70d..d14020d9 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,7 +4,6 @@ "editorconfig.editorconfig", "tekumara.typos-vscode", "dprint.dprint", - "kachick.vscode-yamlfmt", "stylelint.vscode-stylelint", "jnoortheen.nix-ide" ] diff --git a/.vscode/settings.json b/.vscode/settings.json index 8d7a9635..33c96cbf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,6 @@ { "editor.defaultFormatter": "dprint.dprint", "editor.formatOnSave": true, - "[yaml]": { - "editor.defaultFormatter": "kachick.vscode-yamlfmt" - }, - "[github-actions-workflow]": { - "editor.defaultFormatter": "kachick.vscode-yamlfmt" - }, "[elm]": { "editor.defaultFormatter": "elmTooling.elm-ls-vscode" }, diff --git a/dprint.json b/dprint.json index 9723b87b..5511e021 100644 --- a/dprint.json +++ b/dprint.json @@ -9,6 +9,7 @@ }, "json": {}, "markdown": {}, + "yaml": { "quotes": "preferSingle" }, "malva": { "quotes": "preferSingle" }, @@ -20,6 +21,7 @@ "https://plugins.dprint.dev/json-0.19.3.wasm", "https://plugins.dprint.dev/markdown-0.17.1.wasm", "https://plugins.dprint.dev/g-plane/malva-v0.5.1.wasm", - "https://plugins.dprint.dev/g-plane/markup_fmt-v0.10.0.wasm" + "https://plugins.dprint.dev/g-plane/markup_fmt-v0.10.0.wasm", + "https://plugins.dprint.dev/g-plane/pretty_yaml-v0.2.0.wasm" ] } diff --git a/flake.nix b/flake.nix index 71a11d98..2b5365fd 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,6 @@ nil nixpkgs-fmt dprint - yamlfmt nodejs_20 elmPackages.elm-json deno diff --git a/package.json b/package.json index a93e5f5e..f7a03762 100644 --- a/package.json +++ b/package.json @@ -13,8 +13,8 @@ "lint": "deno lint && elm-review && npm run stylelint:check", "check": "typos && npm run format:check && npm run typecheck && npm test && npm run lint", "preview": "vite preview", - "format:check": "dprint check && yamlfmt -lint . && npx elm-format --validate src", - "format:fix": "dprint fmt && yamlfmt . && npx elm-format src", + "format:check": "dprint check && npx elm-format --validate src", + "format:fix": "dprint fmt && npx elm-format src", "stylelint:check": "npx stylelint '{src,public}/**/*.css'", "stylelint:fix": "npx stylelint '{src,public}/**/*.css' --fix", "typecheck": "tsc", diff --git a/yamlfmt.yml b/yamlfmt.yml deleted file mode 100644 index 417bd4f0..00000000 --- a/yamlfmt.yml +++ /dev/null @@ -1,7 +0,0 @@ -gitignore_excludes: true -line_ending: lf -formatter: - type: basic - retain_line_breaks_single: true - # https://github.com/google/yamlfmt/issues/182 - scan_folded_as_literal: true