From efd96e8df6805a45aaf5822141dee11c642b51ae Mon Sep 17 00:00:00 2001 From: Akshay Date: Tue, 2 Aug 2022 16:57:04 +0530 Subject: init --- readme | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 readme (limited to 'readme') diff --git a/readme b/readme new file mode 100644 index 0000000..869e43e --- /dev/null +++ b/readme @@ -0,0 +1,38 @@ +Accepts a list of files as args and returns pairs of duplicate files, one pair +per line. + +Usage: +----- + + cargo run --release --quiet -- [FILES] + + +Example: +------- + + cargo run ---release --quiet -- js-files/*.js + + +Internals: +--------- + +The tool uses tree-sitter to produce ASTs for the given files. It then lazily +traverses the trees of the two files to be compared and exits on encountering +the first structural difference in the ASTs. + + +Known issues: +------------ + +- A fully commented-out file is equivalent to every other fully commented-out + file and to empty files + +- Does not account for equivalence of unordered children: + + ==== file1.rs ==== ==== file2.rs ==== + fn bar(x, y, z) {} fn foo(a, b) {} + fn foo(a, b) {} fn bar(x, y, z) {} + + Here, `function` nodes are "unordered" children, the files are structurally + equivalent because the order of `function` nodes is irrelevant. However, the + tool considers these files to be unique. -- cgit v1.2.3