From 9ddc0d0d421dc7c700cd5516b91fc3c356e5c1dc Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Thu, 6 Jun 2024 20:37:28 +0300 Subject: [PATCH] swap shfmt for prettier-plugin-sh --- .pre-commit-config.yaml | 13 ++++++------ .prettierignore | 2 ++ .prettierrc | 6 +++++- package.json | 1 + pnpm-lock.yaml | 45 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 59 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f50e6c08..3821b455 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,8 +32,7 @@ repos: # and lack of it break things. Use identify-cli for figuring out more # types to add. exclude_types: [svg, tsv] - - id: end-of-file-fixer - exclude: ^etc\/nginx\/.*$ + #- id: end-of-file-fixer - id: check-yaml - id: check-added-large-files # These are not from `pre-commit sample-config` @@ -161,11 +160,11 @@ repos: #- id: black-jupyter # Shell code formatter, requires Go - - repo: https://github.com/scop/pre-commit-shfmt - rev: v3.8.0-1 - hooks: - - id: shfmt - #- id: shfmt-docker + # - repo: https://github.com/scop/pre-commit-shfmt + # rev: v3.8.0-1 + # hooks: + # - id: shfmt + #- id: shfmt-docker # .editorconfig validity checking - repo: https://github.com/editorconfig-checker/editorconfig-checker.python diff --git a/.prettierignore b/.prettierignore index ada29c5a..eb4dcb0e 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,5 @@ *.py* *.jupyter *.json +# prettier-plugin-sh is very unhappy with it +rc/zshrc diff --git a/.prettierrc b/.prettierrc index ffe42cb8..579aea1b 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,8 @@ { - "plugins": ["prettier-plugin-nginx", "prettier-plugin-toml"], + "plugins": [ + "prettier-plugin-nginx", + "prettier-plugin-toml", + "prettier-plugin-sh" + ], "overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }] } diff --git a/package.json b/package.json index 19be9ad9..6a566e0c 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "devDependencies": { "prettier": "3.2.5", "prettier-plugin-nginx": "1.0.3", + "prettier-plugin-sh": "0.14.0", "prettier-plugin-toml": "2.0.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 72f3b387..922b0860 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,6 +13,9 @@ importers: prettier-plugin-nginx: specifier: 1.0.3 version: 1.0.3 + prettier-plugin-sh: + specifier: 0.14.0 + version: 0.14.0(prettier@3.2.5) prettier-plugin-toml: specifier: 2.0.1 version: 2.0.1(prettier@3.2.5) @@ -30,12 +33,27 @@ packages: integrity: sha512-DV/Re3DPVY+BhBtLZ3dmP4mP6YMLSsgq9qGLXwOV38lvNF/fBlgvQswzlXmzCEefL/3q2eMoefZpOI/+GLuCNA==, } + mvdan-sh@0.10.1: + resolution: + { + integrity: sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==, + } + prettier-plugin-nginx@1.0.3: resolution: { integrity: sha512-vV5q85s8XnV6NEgvz1gVLfZhmxAxY03MyOYj2ApBpjFkbs00lRsRkTmqO9L39ADuD18z1RRCcfZ3eVxKhI/nqg==, } + prettier-plugin-sh@0.14.0: + resolution: + { + integrity: sha512-hfXulj5+zEl/ulrO5kMuuTPKmXvOg0bnLHY1hKFNN/N+/903iZbNp8NyZBTsgI8dtkSgFfAEIQq0IQTyP1ZVFQ==, + } + engines: { node: ">=16.0.0" } + peerDependencies: + prettier: ^3.0.3 + prettier-plugin-toml@2.0.1: resolution: { @@ -53,6 +71,19 @@ packages: engines: { node: ">=14" } hasBin: true + sh-syntax@0.4.2: + resolution: + { + integrity: sha512-/l2UZ5fhGZLVZa16XQM9/Vq/hezGGbdHeVEA01uWjOL1+7Ek/gt6FquW0iKKws4a9AYPYvlz6RyVvjh3JxOteg==, + } + engines: { node: ">=16.0.0" } + + tslib@2.6.3: + resolution: + { + integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==, + } + snapshots: "@taplo/core@0.1.1": {} @@ -60,11 +91,25 @@ snapshots: dependencies: "@taplo/core": 0.1.1 + mvdan-sh@0.10.1: {} + prettier-plugin-nginx@1.0.3: {} + prettier-plugin-sh@0.14.0(prettier@3.2.5): + dependencies: + mvdan-sh: 0.10.1 + prettier: 3.2.5 + sh-syntax: 0.4.2 + prettier-plugin-toml@2.0.1(prettier@3.2.5): dependencies: "@taplo/lib": 0.4.0-alpha.2 prettier: 3.2.5 prettier@3.2.5: {} + + sh-syntax@0.4.2: + dependencies: + tslib: 2.6.3 + + tslib@2.6.3: {}