You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently setting options from a file, similar to what is described in #413.
An issue I am having is that the options loaded in this way bypass validation, so bogus parameters can be inserted, and (more importantly for my case), type validation is not attempted. For example, if a Thor option is changed from a string to an array, if the config file sets that option as a string, it will remain as a string in the options hash. If code is dependent on this option being an array, things begin to fall apart.
If there's a way to instead merge a hash with the hash from
, that would probably work (i.e. override that method and merge one hash over the other). One issue with this (and the original method) is that defaults are resolved without us knowing if option values are default or user-provided. If there's a way to provide the initial hash before defaults are resolved, that would be ideal.
Thank you!
The text was updated successfully, but these errors were encountered:
Hello,
I am currently setting options from a file, similar to what is described in #413.
An issue I am having is that the options loaded in this way bypass validation, so bogus parameters can be inserted, and (more importantly for my case), type validation is not attempted. For example, if a Thor option is changed from a string to an array, if the config file sets that option as a string, it will remain as a string in the options hash. If code is dependent on this option being an array, things begin to fall apart.
If there's a way to instead merge a hash with the hash from
thor/lib/thor/parser/options.rb
Lines 88 to 139 in e4907fd
Thank you!
The text was updated successfully, but these errors were encountered: