From 5002156e326925c27c4e0e07199f2db030135337 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Tue, 6 May 2025 14:55:26 -0400 Subject: [PATCH] ci: Add check for formatting `default.json` (#30034) This PR adds a check in CI to ensure that `assets/settings/default.json` is formatted consistently. Release Notes: - N/A --- .github/workflows/ci.yml | 12 +++++++++++- .prettierrc | 3 +++ docs/.prettierrc | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .prettierrc create mode 100644 docs/.prettierrc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dd1bf629d..9acda01beb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,13 +162,23 @@ jobs: working-directory: ./docs run: | pnpm dlx prettier@${PRETTIER_VERSION} . --check || { - echo "To fix, run from the root of the zed repo:" + echo "To fix, run from the root of the Zed repo:" echo " cd docs && pnpm dlx prettier@${PRETTIER_VERSION} . --write && cd .." false } env: PRETTIER_VERSION: 3.5.0 + - name: Prettier Check on default.json + run: | + pnpm dlx prettier@${PRETTIER_VERSION} assets/settings/default.json --check || { + echo "To fix, run from the root of the Zed repo:" + echo " pnpm dlx prettier@${PRETTIER_VERSION} assets/settings/default.json --write" + false + } + env: + PRETTIER_VERSION: 3.5.0 + # To support writing comments that they will certainly be revisited. - name: Check for todo! and FIXME comments run: script/check-todos diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000000..963354f231 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "printWidth": 120 +} diff --git a/docs/.prettierrc b/docs/.prettierrc new file mode 100644 index 0000000000..1c5e966021 --- /dev/null +++ b/docs/.prettierrc @@ -0,0 +1,3 @@ +{ + "printWidth": 80 +}