Shopify / packwerk

Good things come in small packages.
MIT License
1.54k stars 111 forks source link

Convert `custom_associations` to array of symbols #356

Closed shioyama closed 1 year ago

shioyama commented 1 year ago

What are you trying to accomplish?

Having symbols in a yaml array is less natural than an array of strings, yet if you set an array of strings for custom_associations then Packwerk will simply ignore them without any error.

And actually, the example config itself has an array of strings:

https://github.com/Shopify/packwerk/blob/066bd486b355e7e2f5f0101fc8ad64735767deea/lib/packwerk/generators/templates/packwerk.yml.erb#L15-L17

What approach did you choose and why?

Just convert them to symbols when assigning from yaml.

What should reviewers focus on?

Why wasn't Sorbet blowing up on this? There's a T.let assigning to an array of symbols, yet it was assigning an array of Strings, that should be a problem. 🤔

Type of Change

Additional Release Notes

Include any notes here to include in the release description. For example, if you selected "breaking change" above, leave notes on how users can transition to this version.

If no additional notes are necessary, delete this section or leave it unchanged.

Checklist