Last active
February 18, 2016 17:46
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see jscpd