Skip to content

Commit

Permalink
Danger: badge examples are not lib/ + wordsmith (#1381)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmelnikow authored Dec 21, 2017
1 parent 2f9307a commit 78bb20d
Showing 1 changed file with 11 additions and 4 deletions.
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

0 comments on commit 78bb20d

Please sign in to comment.