Class: Bucky::Tools::Lint

Inherits:
Object
  • Object
show all
Extended by:
Utils::YamlLoad
Defined in:
lib/bucky/tools/lint.rb

Constant Summary collapse

@@config_dir =
"#{$bucky_home_dir}/config/**/*yml"
@@rule_config_dir =
File.expand_path('../../../template/new/config', __dir__) + '/*yml'

Class Method Summary collapse

Methods included from Utils::YamlLoad

file_sort_hierarchy, load_yaml

Class Method Details

.check(category) ⇒ Object



13
14
15
16
# File 'lib/bucky/tools/lint.rb', line 13

def check(category)
  method = "check_#{category}".to_sym
  respond_to?(method) ? send(method) : raise(StandardError, "no such a category #{category}")
end

.check_configObject

If you want to add new category, please make new method



19
20
21
22
23
24
25
26
# File 'lib/bucky/tools/lint.rb', line 19

def check_config
  data = merge_yaml_data(@@config_dir)
  @rule_data = merge_yaml_data(@@rule_config_dir)
  actual = make_key_chain(data)
  expect = make_key_chain(@rule_data)
  diff = diff_arr(expect, actual)
  make_message(diff)
end