-
Notifications
You must be signed in to change notification settings - Fork 6
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
#156: implement calculate rejection pull request rate for repos #205
Conversation
@Yegorov good to continue here? |
@yegor256 I pushed updated PR |
all_q = "repo:#{repo} type:pr closed:>#{$SINCE.utc.iso8601[0..10]}" | ||
all_prs_count += Fbe.octo.search_issues(all_q)[:total_count] | ||
|
||
unmerged_q = "repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}" |
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.
@Yegorov same here, this variable is a noise: https://www.yegor256.com/2015/09/01/redundant-variables-are-evil.html
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.
@yegor256 Does it really look better?
unmerged_prs_count += Fbe.octo.search_issues("repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}")[:total_count]
what is it
unmerged_q = "repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}"
unmerged_prs_count += Fbe.octo.search_issues(unmerged_q)[:total_count]
And in the end I get this
judges/quality-of-service/quality-of-service.rb:114:121: C: Layout/LineLength: Line is too long. [133/120]
unmerged_prs_count += Fbe.octo.search_issues("repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}")[:total_count]
unmerged_prs_count += Fbe.octo.search_issues(
"repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}"
)[:total_count]
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.
@Yegorov a few changes required
@yegor256 fixed |
"repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}" | ||
)[:total_count] | ||
end | ||
f.average_pull_rejection_rate = |
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.
@Yegorov if you make variable names shorter, you can write this expression in just one line
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.
@yegor256 no, 3 symbols left
judges/quality-of-service/quality-of-service.rb:114:121: C: Layout/LineLength: Line is too long. [123/120]
rejected += Fbe.octo.search_issues("repo:#{repo} type:pr is:unmerged closed:>#{$SINCE.utc.iso8601[0..10]}")[:total_count]
^^^
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.
@Yegorov you don't need to check for rejected.zero?
, just a check for pulls.zero?
is enough
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.
@yegor256 ok, fixed
@yegor256 fixed |
@Yegorov thanks! |
@yegor256 Hey there! 👋 Great job on the review! You've snagged +37 points: +25 for being an awesome reviewer, and +12 for those 12 thoughtful comments you made. That's some solid work! 🌟 Just a heads up, we award points for hits-of-code too, so keep that in mind for future reviews. Your current balance is sitting at -581. Keep up the fantastic work, and let's see that balance climb! 💪 |
Merge this PR fbe#48 before