8000 add the --verify option by pkozlowski-opensource · Pull Request #669 · gulpjs/gulp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add the --verify option #669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2014
Merged

add the --verify option #669

merged 1 commit into from
Sep 13, 2014

Conversation

pkozlowski-opensource
Copy link
Contributor

This is the second attempt at #535 - this time targeting the gulp 4 branch. I think I've tackled all the comments left in the original PR (#668)

pkgPath = path.join(env.configBase, pkgPath);
}
gutil.log('Verifying plugins in ' + pkgPath);< 8000 /span>
return verifyDeps(require(pkgPath).devDependencies || {});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too much nesting, use vars.

shouldn't it also check dependencies as well? verify(Object.keys(devDeps).concat(Object.keys(deps))) makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeh, I was wondering but I though that we don't want to promote the situation where people put gulp plugins as dependencies. Unless there is a legitimate use-case for declaring gulp plugins as dependencies instead of devDependencies?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkozlowski-opensource It isn't promoting it, just supporting. --verify should support all deps, normal/peer/dev otherwise we are going to get hosed with "bugs" like "--verify does not works"

@phated
Copy link
Member
phated commented Sep 7, 2014

To answer the question of whether blackList.json should be an npm module: I don't think it should be due to it being constantly influx. If it were in npm, it would need to be versioned and I don't think applying semver to it makes sense.

@@ -68,6 +70,15 @@ function handleArguments(env) {
process.exit(0);
}

if (opts.verify) {
var pkgPath = opts.verify !== true ? opts.verify : 'package.json';
if (path.resolve(pkgPath) !== path.normalize(pkgPath)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are probably modules for finding the package.json that may be more verbose than this.

@phated
Copy link
Member
phated commented Sep 7, 2014

Can't we just use https://github.com/tkellen/node-matchdep for this? /cc @tkellen

@yocontra
Copy link
Member
yocontra commented Sep 7, 2014

@phated nice find - I think matchdep.filterAll('*').filter(isInBlackList).forEach(log) (pseudo-code) would get the job done

@phated
Copy link
Member
phated commented Sep 7, 2014

@contra couldn't you just use the blacklist array as the filterAll glob and then log the results?

@yocontra
Copy link
Member
yocontra commented Sep 7, 2014

@phated also makes sense

@pkozlowski-opensource
Copy link
Contributor Author

Wohaaa, this is awesome - this is what I love about open source and people who care about code quality! Thank you guys, I'm going to work through all the comments.

@sindresorhus
Copy link
Contributor

To answer the question of whether blackList.json should be an npm module: I don't think it should be due to it being constantly influx. If it were in npm, it would need to be versioned and I don't think applying semver to it makes sense.

👍


/**
* Given a collection of plugin names verifies this collection against
* the black-list. Invokes callback with an object:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blacklist

@tkellen
Copy link
tkellen commented Sep 8, 2014

👍 rad feature

@phated
Copy link
Member
phated commented Sep 13, 2014

I'm going to merge this and clean it up since I am working on gulp4 today and want to rebase. Thanks @pkozlowski-opensource, always love when you jump in.

phated added a commit that referenced this pull request Sep 13, 2014
@phated phated merged commit 886a3d2 into gulpjs:4.0 Sep 13, 2014
@phated
Copy link
Member
phated commented Sep 14, 2014

Cleaned up in 39ad456

@phated
Copy link
Member
phated commented Sep 14, 2014

More in f32c172 - keeping the logging and fetching in the bin make it easier to test the parts that matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0