lib/cc/cli/config_generator.rb in codeclimate-0.48.0 vs lib/cc/cli/config_generator.rb in codeclimate-0.49.0
- old
+ new
@@ -35,10 +35,18 @@
result[name] = config
end
end
end
+ def codeclimate_checks
+ @codeclimate_checks ||= engine_registry.list.each_with_object({}) do |(name, config), result|
+ if code_climate_check?(config)
+ result[name] = config
+ end
+ end
+ end
+
def errors
[]
end
def exclude_paths
@@ -59,9 +67,13 @@
end
end
def engine_eligible?(engine)
!engine["community"] && engine["enable_regexps"].present? && files_exist?(engine)
+ end
+
+ def code_climate_check?(engine)
+ engine["code_climate_check"] && ENV["RUN_CODECLIMATE_CHECKS"] == "true"
end
def files_exist?(engine)
workspace_files.any? do |path|
engine["enable_regexps"].any? { |re| Regexp.new(re).match(path) }