Sha256: d01dd885e473723a3de68b7cd5d01ca6fe9c2e97f240ab73fef3a13187d70b4a

Contents?: true

Size: 463 Bytes

Versions: 1

Compression:

Stored size: 463 Bytes

Contents

module Pluginscan
  # Extends Check with helpers for making patterns and ignores based on a list of variables or constantst
  class VariableCheck < Check
    def initialize(check_hash)
      super(check_hash)
      @patterns = Array(check_hash[:variables]).map{ |var| Regexp.new(Regexp.escape(var)) }
    end

    def ignore?(variable, content)
      VariableSafetyChecker.new.all_safe?(variable, content) || CommentChecker.commented?(content)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pluginscan-0.9.0 lib/pluginscan/reports/issues_report/issue_checks/variable_check.rb