Class: Archsight::Linter

Inherits:
Object
  • Object
show all
Defined in:
lib/archsight/linter.rb

Constant Summary collapse

VALID_COMPONENTS =

Valid @component references in View annotations

%w[activity git jira languages owner repositories status].freeze

Instance Method Summary collapse

Constructor Details

#initialize(database) ⇒ Linter

Returns a new instance of Linter.



10
11
12
13
# File 'lib/archsight/linter.rb', line 10

def initialize(database)
  @database = database
  @errors = []
end

Instance Method Details

#validateObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/archsight/linter.rb', line 15

def validate
  @database.instances.each_value do |instances_hash|
    instances_hash.each_value do |instance|
      validate_instance_annotations(instance)
      validate_view_fields(instance) if instance.klass == "View"
    end
  end

  @errors
end