From 6e2a5a81a391d5eea6bddffbf14fea6a9fa7bac2 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Sun, 13 Aug 2023 23:06:45 -0700 Subject: [PATCH] Mention --check-only in the FAQ --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 307b678e28..3c241ae0c5 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,21 @@ showing one way to use difftastic with magit. Probably not. Difftastic is young. Consider writing a plugin for your favourite tool, and I will link it in the README! +### Can I use difftastic to check for syntactic changes without diffing? + +Yes. Difftastic can check if the two files have the same AST, without +calculating a diff. This is much faster than normal diffing, and +useful for building tools that check for changes. + +For example: + +``` +$ difft --check-only --exit-code before.js after.js +``` + +This will set the exit code to 0 if there are no syntactic changes, or +1 if there are changes found. + ## Translation + [Chinese](./translation/zh-CN/README-zh-CN.md)