eslint-release
Advanced tools
Comparing version 0.3.0-alpha.2 to 0.3.0-beta.0
@@ -18,3 +18,3 @@ /** | ||
semver = require("semver"), | ||
checker = require("npm-license"), | ||
// checker = require("npm-license"), | ||
dateformat = require("dateformat"), | ||
@@ -27,5 +27,5 @@ ShellOps = require("./shell-ops"); | ||
var OPEN_SOURCE_LICENSES = [ | ||
/MIT/, /BSD/, /Apache/, /ISC/, /WTF/, /Public Domain/ | ||
]; | ||
// var OPEN_SOURCE_LICENSES = [ | ||
// /MIT/, /BSD/, /Apache/, /ISC/, /WTF/, /Public Domain/ | ||
// ]; | ||
@@ -95,2 +95,3 @@ /** | ||
// TODO: Make this async | ||
/** | ||
@@ -101,52 +102,52 @@ * Validates the licenses of all dependencies are valid open source licenses. | ||
*/ | ||
function checkLicenses() { | ||
// function checkLicenses() { | ||
/** | ||
* Check if a dependency is eligible to be used by us | ||
* @param {object} dependency dependency to check | ||
* @returns {boolean} true if we have permission | ||
* @private | ||
*/ | ||
function isPermissible(dependency) { | ||
var licenses = dependency.licenses; | ||
// /** | ||
// * Check if a dependency is eligible to be used by us | ||
// * @param {object} dependency dependency to check | ||
// * @returns {boolean} true if we have permission | ||
// * @private | ||
// */ | ||
// function isPermissible(dependency) { | ||
// var licenses = dependency.licenses; | ||
if (Array.isArray(licenses)) { | ||
return licenses.some(function(license) { | ||
return isPermissible({ | ||
name: dependency.name, | ||
licenses: license | ||
}); | ||
}); | ||
} | ||
// if (Array.isArray(licenses)) { | ||
// return licenses.some(function(license) { | ||
// return isPermissible({ | ||
// name: dependency.name, | ||
// licenses: license | ||
// }); | ||
// }); | ||
// } | ||
return OPEN_SOURCE_LICENSES.some(function(license) { | ||
return license.test(licenses); | ||
}); | ||
} | ||
// return OPEN_SOURCE_LICENSES.some(function(license) { | ||
// return license.test(licenses); | ||
// }); | ||
// } | ||
console.log("Validating licenses"); | ||
// console.log("Validating licenses"); | ||
checker.init({ | ||
start: process.cwd() | ||
}, function(deps) { | ||
var impermissible = Object.keys(deps).map(function(dependency) { | ||
return { | ||
name: dependency, | ||
licenses: deps[dependency].licenses | ||
}; | ||
}).filter(function(dependency) { | ||
return !isPermissible(dependency); | ||
}); | ||
// checker.init({ | ||
// start: process.cwd() | ||
// }, function(deps) { | ||
// var impermissible = Object.keys(deps).map(function(dependency) { | ||
// return { | ||
// name: dependency, | ||
// licenses: deps[dependency].licenses | ||
// }; | ||
// }).filter(function(dependency) { | ||
// return !isPermissible(dependency); | ||
// }); | ||
if (impermissible.length) { | ||
impermissible.forEach(function(dependency) { | ||
console.error("%s license for %s is impermissible.", | ||
dependency.licenses, | ||
dependency.name | ||
); | ||
}); | ||
ShellOps.exit(1); | ||
} | ||
}); | ||
} | ||
// if (impermissible.length) { | ||
// impermissible.forEach(function(dependency) { | ||
// console.error("%s license for %s is impermissible.", | ||
// dependency.licenses, | ||
// dependency.name | ||
// ); | ||
// }); | ||
// ShellOps.exit(1); | ||
// } | ||
// }); | ||
// } | ||
@@ -266,4 +267,4 @@ /** | ||
console.log("Checking licenses"); | ||
checkLicenses(); | ||
// console.log("Checking licenses"); | ||
// checkLicenses(); | ||
@@ -270,0 +271,0 @@ console.log("Running tests"); |
{ | ||
"name": "eslint-release", | ||
"version": "0.3.0-alpha.2", | ||
"version": "0.3.0-beta.0", | ||
"description": "ESLint Release Tools", | ||
@@ -5,0 +5,0 @@ "main": "./lib/release-ops", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18855
385