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