Skip to content

Instantly share code, notes, and snippets.

@camsjams
Last active February 18, 2016 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camsjams/7e3106f710bea5824dbf to your computer and use it in GitHub Desktop.
Save camsjams/7e3106f710bea5824dbf to your computer and use it in GitHub Desktop.
sample reporter that exits process with non-zero exit code, useful for continuous integration tests
const DUPLICATION_LIMIT = 100;
const FILE_SPAN_LIMIT = 2;
module.exports = function() {
/**
* @see node_modules/jscpd/src/report.coffee
*/
if (this.map.numberOfDuplication > DUPLICATION_LIMIT || this.map.numberOfFiles > FILE_SPAN_LIMIT) {
console.error('Copy Paste detection found too many files over threshold.\n');
console.error(this.stdReporter());
process.exit(1);
}
return [true, true, true];
};
@camsjams
Copy link
Author

see jscpd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment