diff --git a/dprint.json b/dprint.json index 82c59d3ee..46b8be32b 100644 --- a/dprint.json +++ b/dprint.json @@ -1,11 +1,5 @@ { - "includes": [ - "**/*.{toml}" - ], - "excludes": [ - "**/target" - ], - "plugins": [ - "https://plugins.dprint.dev/toml-0.5.3.wasm" - ] - } \ No newline at end of file + "includes": ["**/*.{toml}"], + "excludes": ["**/target"], + "plugins": ["https://plugins.dprint.dev/toml-0.5.3.wasm"] +} diff --git a/scripts/pre-commit.sh b/scripts/pre-commit.sh index 4106624b8..a01d1ba34 100755 --- a/scripts/pre-commit.sh +++ b/scripts/pre-commit.sh @@ -1,8 +1,15 @@ #!/bin/sh # Prevent committing badly formatted code + cargo fmt -- --check if [ $? -ne 0 ]; then echo "Run \`cargo fmt\` to fix formatting issues before committing." exit 1 fi + +dprint check +if [ $? -ne 0 ]; then + echo "Run \`dprint fmt\` to fix formatting issues before committing." + exit 1 +fi