From 4be7eece8c68a96241b9e528884621618397c7f0 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sat, 25 Oct 2025 09:04:04 -0700 Subject: [PATCH] just prettier, just format shortcuts --- Justfile | 7 +++++++ docs/contributing.rst | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/Justfile b/Justfile index 172de444..60005a2d 100644 --- a/Justfile +++ b/Justfile @@ -36,6 +36,13 @@ export DATASETTE_SECRET := "not_a_secret" @black: pipenv run black . +# Apply prettier +@prettier: + npm run fix + +# Format code with both black and prettier +@format: black prettier + @serve: pipenv run sqlite-utils create-database data.db pipenv run sqlite-utils create-table data.db docs id integer title text --pk id --ignore diff --git a/docs/contributing.rst b/docs/contributing.rst index b4aab6ed..12c8d477 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -131,6 +131,15 @@ These formatters are enforced by Datasette's continuous integration: if a commit When developing locally, you can verify and correct the formatting of your code using these tools. +If you are using `Just `__ the quickest way to run these is like so:: + + just black + just prettier + +Or run both at the same time:: + + just format + .. _contributing_formatting_black: Running Black