Class: Danger::DangerLgtm
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerLgtm
- Includes:
- Lgtm::ErrorHandleable
- Defined in:
- lib/lgtm/plugin.rb
Overview
Lgtm let danger say lgtm when there is no violations. Default use random lgtm image from [lgtm.in](lgtm.in).
Constant Summary collapse
- RANDOM_LGTM_POST_URL =
'https://lgtm.in/g'.freeze
Constants included from Lgtm::ErrorHandleable
Lgtm::ErrorHandleable::CLIENT_ERRORS, Lgtm::ErrorHandleable::SERVER_ERRORS
Instance Method Summary collapse
-
#check_lgtm(image_url: nil, https_image_only: false) ⇒ void
Check status report, say lgtm if no violations Generates a ‘markdown` of a lgtm image.
Methods included from Lgtm::ErrorHandleable
Instance Method Details
#check_lgtm(image_url: nil, https_image_only: false) ⇒ void
This method returns an undefined value.
Check status report, say lgtm if no violations Generates a ‘markdown` of a lgtm image.
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/lgtm/plugin.rb', line 32 def check_lgtm(image_url: nil, https_image_only: false) return unless status_report[:errors].length.zero? && status_report[:warnings].length.zero? image_url ||= fetch_image_url(https_image_only: https_image_only) markdown( markdown_template(image_url) ) end |