app/mediators/receive_issue_comment_event.rb
# Checks if the given string can be taken as an affirmative review.
#
# Recognized approval phrases (all case insensitive):
#
# * "LGTM"
# * ":+1:" # the GitHub thumbs-up emoji string
# * "Looks good"
# * "Looks good to me"
#
# comment - String to check
#
# Returns true if the comment is affirmative; false otherwise.
Checks if the given string can be taken as an affirmative review.
Recognized approval phrases (all case insensitive).



String to check

Returns true if the comment is affirmative; false otherwise.
Checks if the given string can be taken as an affirmative review . Recognized approval phrases ( all case insensitive ) . String to check Returns true if the comment is affirmative ; false otherwise .
def comment_affirmative?(comment)
    return true if comment == "cody approve"
    phrases = %w(
      lgtm
      looks\s+good(?:\s+to\s+me)?
      👍
      🆗
      🚀
      💯
    )
    emojis = %w(
      \+1
      ok
      shipit
      rocket
      100
    ).map { |e| ":#{e}:" }
    affirmatives = (phrases + emojis).map { |a| "(^\\s*#{a}\\s*$)" }
    joined = affirmatives.join("|")
    !!(comment =~ /#{joined}/i)
  end
def comment_affirmative? ( comment ) return true if comment == "cody approve" phrases = %w( lgtm looks\s+good(?:\s+to\s+me)? 👍 🆗 🚀 💯 ) emojis = %w( 
      \+ 1 ok shipit rocket 100 ) . map { | e | ":#{e}:" } affirmatives = ( phrases + emojis ) . map { | a | "(^\\s*#{a}\\s*$)" } joined = affirmatives . join ( "|" ) ! ! ( comment =~ / #{ joined } /i ) end
Checks if the given string can be taken as an affirmative review.
Checks if the given string can be taken as an affirmative review .
# emojis need some extra processing so we handle them separately
comment
<not_specific>