Class: Danger::DangerTextlint
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerTextlint
- Defined in:
- lib/textlint/plugin.rb
Overview
[Danger](danger.systems/ruby/) plugin for [textlint](textlint.github.io/).
Instance Attribute Summary collapse
-
#config_file ⇒ String
.textlintrc path.
-
#max_comment_num ⇒ String
Set max danger reporting comment number choice: nil or integer.
-
#max_severity ⇒ String
Set max danger reporting severity choice: nil or “warn”.
Instance Method Summary collapse
-
#lint ⇒ void
Execute textlint and send comment.
Instance Attribute Details
#config_file ⇒ String
.textlintrc path
28 29 30 |
# File 'lib/textlint/plugin.rb', line 28 def config_file @config_file end |
#max_comment_num ⇒ String
Set max danger reporting comment number choice: nil or integer
38 39 40 |
# File 'lib/textlint/plugin.rb', line 38 def max_comment_num @max_comment_num end |
#max_severity ⇒ String
Set max danger reporting severity choice: nil or “warn”
33 34 35 |
# File 'lib/textlint/plugin.rb', line 33 def max_severity @max_severity end |
Instance Method Details
#lint ⇒ void
This method returns an undefined value.
Execute textlint and send comment
42 43 44 45 46 47 48 49 |
# File 'lib/textlint/plugin.rb', line 42 def lint return if target_files.empty? bin = textlint_path result_json = run_textlint(bin, target_files) errors = parse(result_json) send_comment(errors) end |