From 066bd486b355e7e2f5f0101fc8ad64735767deea Mon Sep 17 00:00:00 2001 From: Chris Salzberg Date: Thu, 18 May 2023 09:41:22 +0900 Subject: [PATCH] Convert custom_associations to array of symbols --- lib/packwerk/configuration.rb | 2 +- test/unit/packwerk/configuration_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/packwerk/configuration.rb b/lib/packwerk/configuration.rb index 909fe64e0..22a7dee20 100644 --- a/lib/packwerk/configuration.rb +++ b/lib/packwerk/configuration.rb @@ -75,7 +75,7 @@ def initialize(configs = {}, config_path: nil) 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) diff --git a/test/unit/packwerk/configuration_test.rb b/test/unit/packwerk/configuration_test.rb index 91202e260..49e35e523 100644 --- a/test/unit/packwerk/configuration_test.rb +++ b/test/unit/packwerk/configuration_test.rb @@ -42,7 +42,7 @@ class ConfigurationTest < Minitest::Test assert_equal ["{exclude_dir,bin,tmp}/**/*"], configuration.exclude assert_equal app_dir, configuration.root_path assert_equal "**/*/", configuration.package_paths - assert_equal ["custom_association"], configuration.custom_associations + assert_equal [:custom_association], configuration.custom_associations end test ".from_path falls back to some default config when no existing config exists" do