aboutsummaryrefslogtreecommitdiff
path: root/readme
diff options
context:
space:
mode:
authorAkshay <[email protected]>2022-08-02 12:27:04 +0100
committerAkshay <[email protected]>2022-08-02 12:27:04 +0100
commitefd96e8df6805a45aaf5822141dee11c642b51ae (patch)
tree56cca3a780dd0753e21eb5e0dbda585ce6ff7f7b /readme
init
Diffstat (limited to 'readme')
-rw-r--r--readme38
1 files changed, 38 insertions, 0 deletions
diff --git a/readme b/readme
new file mode 100644
index 0000000..869e43e
--- /dev/null
+++ b/readme
@@ -0,0 +1,38 @@
1Accepts a list of files as args and returns pairs of duplicate files, one pair
2per line.
3
4Usage:
5-----
6
7 cargo run --release --quiet -- [FILES]
8
9
10Example:
11-------
12
13 cargo run ---release --quiet -- js-files/*.js
14
15
16Internals:
17---------
18
19The tool uses tree-sitter to produce ASTs for the given files. It then lazily
20traverses the trees of the two files to be compared and exits on encountering
21the first structural difference in the ASTs.
22
23
24Known issues:
25------------
26
27- A fully commented-out file is equivalent to every other fully commented-out
28 file and to empty files
29
30- Does not account for equivalence of unordered children:
31
32 ==== file1.rs ==== ==== file2.rs ====
33 fn bar(x, y, z) {} fn foo(a, b) {}
34 fn foo(a, b) {} fn bar(x, y, z) {}
35
36 Here, `function` nodes are "unordered" children, the files are structurally
37 equivalent because the order of `function` nodes is irrelevant. However, the
38 tool considers these files to be unique.