summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJulianne Swinoga <jswinoga@kepler.space>2025-04-25 11:22:52 -0400
committerDylan Baker <dylan@pnwbakers.com>2025-10-15 09:12:23 -0700
commite0fc33dce2511c60c070064ffd86c746676dd302 (patch)
tree421b848861f5f3c87124dceaa331b0bef7d9aec7 /docs
parent2780f41723967f63b91a2999a79bb009d00b6065 (diff)
downloadmeson-e0fc33dce2511c60c070064ffd86c746676dd302.tar.gz
Add --check-diff to meson format, to show what should be formatted
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Commands.md3
-rw-r--r--docs/markdown/snippets/format-check-diff-option.md8
2 files changed, 11 insertions, 0 deletions
diff --git a/docs/markdown/Commands.md b/docs/markdown/Commands.md
index 09d8fd95f..339dd93b7 100644
--- a/docs/markdown/Commands.md
+++ b/docs/markdown/Commands.md
@@ -496,6 +496,9 @@ or `--inline` arguments.
*Since 1.9.0* Using `-` as source file with `--editor-config` now requires
`--source-file-path` argument to ensure consistent results.
+*Since 1.10.0* When `--check-diff` is specified, instead of silently exiting
+with an error code, `meson format` will print a diff of the formatting changes.
+
#### Differences with `muon fmt`
diff --git a/docs/markdown/snippets/format-check-diff-option.md b/docs/markdown/snippets/format-check-diff-option.md
new file mode 100644
index 000000000..efcab4f89
--- /dev/null
+++ b/docs/markdown/snippets/format-check-diff-option.md
@@ -0,0 +1,8 @@
+## `meson format` has a new `--check-diff` option
+
+When using `meson format --check-only` to verify formatting in CI, it would
+previously silently exit with an error code if the code was not formatted
+correctly.
+
+A new `--check-diff` option has been added which will instead print a diff of
+the required changes and then exit with an error code.