From c9058052e633913246920bf4f2cc24329e8485df Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Sat, 8 Jun 2024 09:32:19 +0300 Subject: [PATCH] copy pre-commit & prettier config from mikaela.github.io --- .pre-commit-config.yaml | 36 +++++++++------ .prettierignore | 3 ++ .prettierrc | 4 ++ package.json | 4 +- pnpm-lock.yaml | 99 ++++++++++++++++++++++++++++++++++++++--- 5 files changed, 127 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e40808e..ee1ce08 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,6 +5,7 @@ # See https://pre-commit.com for more information # See https://pre-commit.ci for more information ci: + skip: [pnpm-prettier] # I don't need so many duplicated notifications on the same thing as I keep # autoupdating manually too. Besides it just creates extra branch I never # touch. @@ -39,6 +40,11 @@ repos: - id: pretty-format-json args: [--autofix, --no-ensure-ascii] + - repo: https://github.com/pre-commit/sync-pre-commit-deps + rev: v0.0.1 + hooks: + - id: sync-pre-commit-deps + - repo: https://github.com/pre-commit-ci/pre-commit-ci-config rev: v1.6.1 hooks: @@ -48,7 +54,7 @@ repos: rev: v2.2.0 hooks: - id: doctoc - args: [--update-only, --notitle] + args: [--update-only, --no-title] - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.28.4 @@ -57,22 +63,26 @@ repos: - id: check-github-workflows - id: check-gitlab-ci - # - repo: https://github.com/fsfe/reuse-tool - # rev: v3.0.2 + # - repo: https://github.com/rbubley/mirrors-prettier + # rev: "v3.3.1" # hooks: - # - id: reuse + # - id: prettier + # additional_dependencies: [ + # # https://www.npmjs.com/package/prettier + # "prettier@3.3.1", + # # https://www.npmjs.com/package/@prettier/plugin-xml + # "@prettier/plugin-xml@3.4.1", + # ] - - repo: https://github.com/rbubley/mirrors-prettier - rev: "v3.3.0" + - repo: local hooks: - - id: prettier + - id: pnpm-prettier + name: prettier + entry: pnpm exec prettier --cache --ignore-unknown --write + language: system + # Better handled by pretty-format-json from pre-commit-hooks. + # Remember to have *.json in .prettierignore! exclude_types: [json] - additional_dependencies: [ - # https://www.npmjs.com/package/prettier - "prettier@3.2.5", - # https://www.npmjs.com/package/@prettier/plugin-xml - "@prettier/plugin-xml@3.4.1", - ] - repo: https://github.com/editorconfig-checker/editorconfig-checker.python rev: "2.7.3" diff --git a/.prettierignore b/.prettierignore index 29f032e..72e79d6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,5 @@ # Prettier cannot handle Jekyll variables? _includes +_layouts +blog/*.xml +*.json diff --git a/.prettierrc b/.prettierrc index e69de29..c924e5f 100644 --- a/.prettierrc +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "plugins": ["@prettier/plugin-xml", "prettier-plugin-sh"], + "overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }] +} diff --git a/package.json b/package.json index d85dc9d..9d5284f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,7 @@ { "devDependencies": { - "prettier": "3.3.0" + "@prettier/plugin-xml": "3.4.1", + "prettier": "3.3.1", + "prettier-plugin-sh": "0.14.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ae165e4..bcc5abc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,18 +7,107 @@ settings: importers: .: devDependencies: + "@prettier/plugin-xml": + specifier: 3.4.1 + version: 3.4.1(prettier@3.3.1) prettier: - specifier: 3.3.0 - version: 3.3.0 + specifier: 3.3.1 + version: 3.3.1 + prettier-plugin-sh: + specifier: 0.14.0 + version: 0.14.0(prettier@3.3.1) packages: - prettier@3.3.0: + "@prettier/plugin-xml@3.4.1": resolution: { - integrity: sha512-J9odKxERhCQ10OC2yb93583f6UnYutOeiV5i0zEDS7UGTdUt0u+y8erxl3lBKvwo/JHyyoEdXjwp4dke9oyZ/g==, + integrity: sha512-Uf/6/+9ez6z/IvZErgobZ2G9n1ybxF5BhCd7eMcKqfoWuOzzNUxBipNo3QAP8kRC1VD18TIo84no7LhqtyDcTg==, + } + peerDependencies: + prettier: ^3.0.0 + + "@xml-tools/parser@1.0.11": + resolution: + { + integrity: sha512-aKqQ077XnR+oQtHJlrAflaZaL7qZsulWc/i/ZEooar5JiWj1eLt0+Wg28cpa+XLney107wXqneC+oG1IZvxkTA==, + } + + chevrotain@7.1.1: + resolution: + { + integrity: sha512-wy3mC1x4ye+O+QkEinVJkPf5u2vsrDIYW9G7ZuwFl6v/Yu0LwUuT2POsb+NUWApebyxfkQq6+yDfRExbnI5rcw==, + } + + mvdan-sh@0.10.1: + resolution: + { + integrity: sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==, + } + + 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@3.3.1: + resolution: + { + integrity: sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==, } engines: { node: ">=14" } hasBin: true + regexp-to-ast@0.5.0: + resolution: + { + integrity: sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==, + } + + 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: - prettier@3.3.0: {} + "@prettier/plugin-xml@3.4.1(prettier@3.3.1)": + dependencies: + "@xml-tools/parser": 1.0.11 + prettier: 3.3.1 + + "@xml-tools/parser@1.0.11": + dependencies: + chevrotain: 7.1.1 + + chevrotain@7.1.1: + dependencies: + regexp-to-ast: 0.5.0 + + mvdan-sh@0.10.1: {} + + prettier-plugin-sh@0.14.0(prettier@3.3.1): + dependencies: + mvdan-sh: 0.10.1 + prettier: 3.3.1 + sh-syntax: 0.4.2 + + prettier@3.3.1: {} + + regexp-to-ast@0.5.0: {} + + sh-syntax@0.4.2: + dependencies: + tslib: 2.6.3 + + tslib@2.6.3: {}