danielstjules / jsinspect

Detect copy-pasted and structurally similar code
MIT License
3.56k stars 128 forks source link

Add option to ignore path #17

Closed mboughaba closed 9 years ago

mboughaba commented 9 years ago

Hi, Is there anyway to ignore files based on a path. I usually have my tests under test directory, it would be great if I can do something like this in .jsinspectrc

{
  "ignore": "test/"
}
mboughaba commented 9 years ago

after investigating the code, I figure out that we could simply add "test" in order to ignore everything under the "test" directory.

// Ignore node_modules by default, along with ignore arg
ignorePatterns = ['node_modules'];
if (program.ignore) {
  ignorePatterns.push(program.ignore);
}

so I could simply set my .jsinspect as

{
  "ignore": "test"
}
danielstjules commented 9 years ago

Glad it worked! :)