rust
rust copied to clipboard
[CI] lint our JSON file indentation
I probably introduced annoying indentation to our config.json. :sweat_smile: I would like to standardize that formatting check using CI.
I propose we steal the prettier action from JavaScript track and use the --check flag.
Then, contributors could run a local script that executes npx prettier -write.
This is similar to #1110.
Fundamental idea is good. prettier is IMO the wrong tool for the job: it's interpreted and requires a node/npm installation. It's also a general-purpose formatter for common frontend languages. For its use case, it's great, but we can leverage the tools CI already has installed with something like
# bash
if [ -n "$(diff config.json "<(jq . config.json)")" ]; then
echo "config.json is improperly formatted"
exit 1
fi