lib/packwerk/configuration.rb in packwerk-3.0.1 vs lib/packwerk/configuration.rb in packwerk-3.1.0
- old
+ new
@@ -58,10 +58,13 @@
attr_reader(:config_path)
sig { returns(Pathname) }
attr_reader(:cache_directory)
+ sig { params(parallel: T::Boolean).returns(T::Boolean) }
+ attr_writer(:parallel)
+
sig do
params(
configs: T::Hash[String, T.untyped],
config_path: T.nilable(String),
).void
@@ -70,10 +73,10 @@
@include = T.let(configs["include"] || DEFAULT_INCLUDE_GLOBS, T::Array[String])
@exclude = T.let(configs["exclude"] || DEFAULT_EXCLUDE_GLOBS, T::Array[String])
root = config_path ? File.dirname(config_path) : "."
@root_path = T.let(File.expand_path(root), String)
@package_paths = T.let(configs["package_paths"] || "**/", T.any(String, T::Array[String]))
- @custom_associations = T.let(configs["custom_associations"] || [], T::Array[Symbol])
+ @custom_associations = T.let((configs["custom_associations"] || []).map(&:to_sym), T::Array[Symbol])
@parallel = T.let(configs.key?("parallel") ? configs["parallel"] : true, T::Boolean)
@cache_enabled = T.let(configs.key?("cache") ? configs["cache"] : false, T::Boolean)
@cache_directory = T.let(Pathname.new(configs["cache_directory"] || "tmp/cache/packwerk"), Pathname)
@config_path = config_path