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

[ACHIEVEMENT] The label maker achievemt #38

Merged
merged 7 commits into from Jan 27, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions achievements/labelBabyJunior.achievement.js
@@ -0,0 +1,30 @@


Copy link
Member

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.

var labelBabyJunior = {
name: 'Label Baby Junior',
check: function(pullRequest, shall) {

Copy link
Member

Choose a reason for hiding this comment

The 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.
I hope that someday soon we'll have a Lint process to catch and warn on this issues.

if (checkIfManyLabels(pullRequest)) {

var achievement = {
avatar : 'images/achievements/theLabelMaker.achievment.jpg',
Copy link
Member

@ortichon ortichon Jan 27, 2017

Choose a reason for hiding this comment

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

typo in the word achievement - image does not load

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' ,
Copy link
Member

Choose a reason for hiding this comment

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

typo in the word organizing

relatedPullRequest: pullRequest._id
};

shall.grant(pullRequest.creator.username, achievement);
}
}
};

function checkIfManyLabels(pullRequest) {
Copy link
Member

Choose a reason for hiding this comment

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

Its is a common practice to prefix with is<FunctionName> functions that return boolean values.

I think that

if (isManyLabels(pullRequest)) { ...

looks and sounds better ;-)

var labels = pullRequest.labels;
if(labels){
return labels.length > 3;
}
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

wrong indentation of }

Copy link
Member

Choose a reason for hiding this comment

The 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;

Copy link
Member Author

Choose a reason for hiding this comment

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

yea


Copy link
Member

Choose a reason for hiding this comment

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

missing a }

please check that your code is running before you push to Github :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

It worked until you made me change it =P

Copy link
Member

Choose a reason for hiding this comment

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

I did noto made you change it, I suggested... :-)

module.exports = labelBabyJunior;
Copy link
Member

Choose a reason for hiding this comment

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

please add one empty line at the end of the file.
see this answer

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.