From 84e55970911084f0d4a16088ae7027e2c2996603 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 29 Nov 2020 21:51:22 +0100 Subject: [PATCH] Add postgrest-docs-dictcheck to remove obsolete words from postgrest.dict --- default.nix | 15 +++++++++++++++ postgrest.dict | 4 ---- shell.nix | 1 + 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/default.nix b/default.nix index 62a18d814..b422be002 100644 --- a/default.nix +++ b/default.nix @@ -57,4 +57,19 @@ in | tee misspellings test ! -s misspellings ''; + + # dictcheck detects obsolete entries in postgrest.dict, that are not used anymore + dictcheck = + pkgs.writeShellScriptBin "postgrest-docs-dictcheck" + '' + set -euo pipefail + + FILES=$(find . -type f -iname '*.rst' | tr '\n' ' ') + + cat postgrest.dict \ + | tail -n+2 \ + | tr '\n' '\0' \ + | xargs -0 -n 1 -i \ + sh -c "grep \"{}\" $FILES > /dev/null || echo \"{}\"" + ''; } diff --git a/postgrest.dict b/postgrest.dict index 03dbef3d3..c0a0e8c82 100644 --- a/postgrest.dict +++ b/postgrest.dict @@ -9,7 +9,6 @@ balancer Bool cd centric -Codd conf config cryptographically @@ -70,7 +69,6 @@ OpenAPI openapi ORM ov -PaaS param params passphrase @@ -108,7 +106,6 @@ SQL sql sr SSL -startup stateful stdout SuperAgent @@ -130,5 +127,4 @@ Vondra WAI Websockets webuser -wildcard ZeroMQ diff --git a/shell.nix b/shell.nix index 37e6d7cbb..81649475d 100644 --- a/shell.nix +++ b/shell.nix @@ -12,5 +12,6 @@ pkgs.mkShell { docs.build docs.serve docs.spellcheck + docs.dictcheck ]; }