Class: AdLint::Postfilter::LineWiseAnnotation

Inherits:
MessageControlAnnotation show all
Defined in:
lib/adlint/postfilter/annotate.rb

Instance Attribute Summary

Attributes inherited from MessageControlAnnotation

#message_controller

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message_controller_str, fpath, line_no) ⇒ LineWiseAnnotation

Returns a new instance of LineWiseAnnotation.



72
73
74
75
# File 'lib/adlint/postfilter/annotate.rb', line 72

def initialize(message_controller_str, fpath, line_no)
  super(message_controller_str)
  @fpath, @line_no = fpath, line_no
end

Class Method Details

.detect(str, fpath, line_no) ⇒ Object



68
69
70
# File 'lib/adlint/postfilter/annotate.rb', line 68

def self.detect(str, fpath, line_no)
  str =~ /(?:ADLINT:LINE:|ADLINT::)\[.*\]/ ? new($&, fpath, line_no) : nil
end

Instance Method Details

#generate_suppressionsObject



78
79
80
81
82
83
# File 'lib/adlint/postfilter/annotate.rb', line 78

def generate_suppressions
  message_controller.message_control_list.map do |mesg_ctrl|
    LineWiseSuppression.new(mesg_ctrl.message_id, @fpath, @line_no,
                            mesg_ctrl.suppression_activation?)
  end
end