kucherenko / jscpd

Copy/paste detector for programming source code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arbitrary extensions for plaintext

OldStarchy opened this issue · comments

commented

Is your feature request related to a problem? Please describe.
I have a directory full of .vm files which are, as far as jscpd is concerned, plain text files. Supposedly plaintext is supported but there's no docs on how to make use of this support.

$ ls velocity/*.vm velocity/**/*.vm | wc -l
18
$ npx jscpd velocity
┌──────────┬────────────────┬─────────────┬──────────────┬──────────────┬──────────────────┬───────────────────┐
│ Format   │ Files analyzed │ Total lines │ Total tokens │ Clones found │ Duplicated lines │ Duplicated tokens │
├──────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ markdown │ 1              │ 24          │ 380          │ 0            │ 0 (0%)           │ 0 (0%)            │
├──────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ Total:   │ 1              │ 24          │ 380          │ 0            │ 0 (0%)           │ 0 (0%)            │
└──────────┴────────────────┴─────────────┴──────────────┴──────────────┴──────────────────┴───────────────────┘
Found 0 clones.
Detection time:: 9.709ms

I've tried setting a --pattern "velocity/**/*.vm" and variations of --format plain --format plaintext --format text, in those cases there's no output as the .md file is ignored

Describe the solution you'd like
I would like to be able to find duplicates across .vm files

Describe alternatives you've considered
I've tried setting a --pattern "velocity/**/*.vm" and variations of --format plain --format plaintext --format text, in those cases there's no output as the .md file is ignored

Additional context
npx jscpd --help shows a --config parameter but I don't see any docs on how to use that either.

please use the following command:

npx jscpd --formats-exts markdown:vm .

in the command, you will find duplication with the markdown parser, but it will work as plain text.

https://github.com/kucherenko/jscpd/tree/master/apps/jscpd#formats-extensions