From cec849eae8177ed40790e4420cfd2527d0c2f596 Mon Sep 17 00:00:00 2001 From: Jack Rose Date: Thu, 21 Dec 2023 20:11:02 +1100 Subject: [PATCH] add prettier for json, yaml, and markdown files --- .prettierignore | 1 + devbox.json | 7 +++++-- devbox.lock | 4 ++++ plugins/dynamodb_local/process-compose.yaml | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..d6be2f6 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +.devbox/ diff --git a/devbox.json b/devbox.json index acdcf73..9efed5c 100644 --- a/devbox.json +++ b/devbox.json @@ -10,7 +10,8 @@ "nixpkgs-fmt", "statix", "shellcheck", - "shfmt" + "shfmt", + "nodePackages.prettier" ], "shell": { "scripts": { @@ -19,12 +20,14 @@ "statix check --ignore .devbox &", "shellcheck **/*.{sh,bats} &", "shfmt --diff **/*.{sh,bats} &", + "prettier . --check &", "wait" ], "lint:fix": [ "nixpkgs-fmt .", "statix fix --ignore .devbox", - "shfmt --write **/*.{sh,bats}" + "shfmt --write **/*.{sh,bats}", + "prettier . --write" ], "test": [ "devbox run test-bash", diff --git a/devbox.lock b/devbox.lock index bbc27de..8607c7f 100644 --- a/devbox.lock +++ b/devbox.lock @@ -17,6 +17,10 @@ "resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#nixpkgs-fmt", "source": "nixpkg" }, + "nodePackages.prettier": { + "resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#nodePackages.prettier", + "source": "nixpkg" + }, "shellcheck": { "resolved": "github:NixOS/nixpkgs/75a52265bda7fd25e06e3a67dee3f0354e73243c#shellcheck", "source": "nixpkg" diff --git a/plugins/dynamodb_local/process-compose.yaml b/plugins/dynamodb_local/process-compose.yaml index 8b905f8..cd880ad 100644 --- a/plugins/dynamodb_local/process-compose.yaml +++ b/plugins/dynamodb_local/process-compose.yaml @@ -2,9 +2,10 @@ version: "0.5" processes: dynamodb_local: - # working_dir set so command is run from a git ignored directory. + # working_dir set so command is run from a git ignored directory. # dynamodb_local creates a metadata file in the directory it starts in, and we # want that to be hidden. + # prettier-ignore working_dir: {{ .Virtenv }} command: dynamodb_local availability: