Class: Danger::DangerHtmllint

Inherits:
Plugin
  • Object
show all
Defined in:
lib/htmllint/plugin.rb

Overview

[Danger](danger.systems/ruby/) plugin depends on [htmllint-cli](github.com/htmllint/htmllint-cli/).

Examples:

Run htmllint and send violations as inline comment.


# Lint added and modified files only
htmllint.lint

See Also:

  • konifar/danger-htmllint

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fail_on_errorBool

Set danger fail when errors are detected

Returns:

  • (Bool)


22
23
24
# File 'lib/htmllint/plugin.rb', line 22

def fail_on_error
  @fail_on_error
end

#rc_pathString

.htmllintrc path

Returns:

  • (String)


18
19
20
# File 'lib/htmllint/plugin.rb', line 18

def rc_path
  @rc_path
end

Instance Method Details

#lintvoid

This method returns an undefined value.

Execute htmllint and send comment



26
27
28
29
30
31
# File 'lib/htmllint/plugin.rb', line 26

def lint
  return if target_files.empty?

  result = run_htmllint(htmllint_bin_path, target_files)
  send_comment(parse(result))
end