Class: AdLint::Postfilter::TranslationUnitWideAnnotation

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, composing_fpaths) ⇒ TranslationUnitWideAnnotation

Returns a new instance of TranslationUnitWideAnnotation.



51
52
53
54
# File 'lib/adlint/postfilter/annotate.rb', line 51

def initialize(message_controller_str, composing_fpaths)
  super(message_controller_str)
  @composing_fpaths = composing_fpaths
end

Class Method Details

.detect(str, composing_fpaths) ⇒ Object



47
48
49
# File 'lib/adlint/postfilter/annotate.rb', line 47

def self.detect(str, composing_fpaths)
  str =~ /ADLINT:TUNIT:\[.*\]/ ? new($&, composing_fpaths) : nil
end

Instance Method Details

#generate_suppressionsObject



57
58
59
60
61
62
63
64
# File 'lib/adlint/postfilter/annotate.rb', line 57

def generate_suppressions
  message_controller.message_control_list.map { |mesg_ctrl|
    @composing_fpaths.map do |fpath|
      FileWiseSuppression.new(mesg_ctrl.message_id, fpath,
                              mesg_ctrl.suppression_activation?)
    end
  }.flatten
end