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
[ACHIEVEMENT] The label maker achievemt #38
Changes from 3 commits
12c5d1b
25fec0d
66c9165
346df0c
21f0980
1bcce5d
fe4eb5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
|
||
var labelBabyJunior = { | ||
name: 'Label Baby Junior', | ||
check: function(pullRequest, shall) { | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove this line too :-) notice that all(all?) other achievements follow the same design rules, It helps to keep organized and maintainable code. |
||
if (checkIfManyLabels(pullRequest)) { | ||
|
||
var achievement = { | ||
avatar : 'images/achievements/theLabelMaker.achievment.jpg', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo in the word |
||
name: 'The Label Maker', | ||
short: 'Is this a label maker?', | ||
description: 'You\'ve put many labels, thank you for organizng. You\'re a gift that keeps on re-giving' , | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo in the word |
||
relatedPullRequest: pullRequest._id | ||
}; | ||
|
||
shall.grant(pullRequest.creator.username, achievement); | ||
} | ||
} | ||
}; | ||
|
||
function checkIfManyLabels(pullRequest) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its is a common practice to prefix with I think that if (isManyLabels(pullRequest)) { ... looks and sounds better ;-) |
||
var labels = pullRequest.labels; | ||
if(labels){ | ||
return labels.length > 3; | ||
} | ||
return false; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wrong indentation of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW - rows 24-27 can be shorten to a one liner: return labels && labels.length > 3; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yea |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing a please check that your code is running before you There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It worked until you made me change it =P There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did noto made you change it, I suggested... :-) |
||
module.exports = labelBabyJunior; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add one empty line at the end of the file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the new lines above.