Skip to content
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

Danger: badge examples are not lib/ + wordsmith #1381

Merged
merged 2 commits into from
Dec 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ const documentation = fileMatch(
);
const server = fileMatch('server.js');
const serviceTests = fileMatch('service-tests/*.js');
const helpers = fileMatch('lib/**/*.js', '!**/*.spec.js');
const helpers = fileMatch(
'lib/**/*.js',
'!**/*.spec.js',
'!lib/all-badge-examples.js'
);
const helperTests = fileMatch('lib/**/*.spec.js');
const packageJson = fileMatch('package.json');
const packageLock = fileMatch('package-lock.json');
Expand All @@ -31,7 +35,10 @@ message([
].join(''));

if (documentation.createdOrModified) {
message('We :heart: our [documentarians](http://www.writethedocs.org/)!');
message([
'Thanks for contributing to our documentation. ',
'We :heart: our [documentarians](http://www.writethedocs.org/)!'
].join(''));
}

if (packageJson.modified && !packageLock.modified) {
Expand All @@ -49,12 +56,12 @@ if (server.modified && !serviceTests.createdOrModified) {

if (helpers.created && !helperTests.created) {
warn([
'This PR added helper modules in lib/ but not accompanying tests. ',
'This PR added helper modules in `lib/` but not accompanying tests. ',
'Generally helper modules should have their own tests.',
].join(''));
} else if (helpers.createdOrModified && !helperTests.createdOrModified) {
warn([
'This PR modified helper functions in lib/ but not accompanying tests. ',
'This PR modified helper functions in `lib/` but not accompanying tests. ',
"That's okay so long as it's refactoring existing code.",
].join(''));
}
Expand Down