Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unexpected non-style keyword args #483

Open
noahgibbs opened this issue Dec 7, 2023 · 0 comments
Open

Fix unexpected non-style keyword args #483

noahgibbs opened this issue Dec 7, 2023 · 0 comments

Comments

@noahgibbs
Copy link
Collaborator

noahgibbs commented Dec 7, 2023

If you run "bundle exec rake test" right now you'll see a lot of messages like these:

Unexpected non-style keyword(s) in Shoes::Para initialize: [:align]

Each of them is a case where we're passing a keyword arg through to Drawable#initialize that it doesn't recognize. That could be a problem in initialize (Stack, Flow) or where we don't properly implement a property (align).

There's already a PR that implements Para style align (#472).

Added a PR for :top, :width and :height on all drawables (#485).

Here are the keyword arguments I see with problems, with duplicates removed and out of order:

Unexpected non-style keyword(s) in Shoes::Para initialize: [:top, :align, :margin]
Unexpected non-style keyword(s) in Shoes::Para initialize: [:margin_bottom]

Unexpected non-style keyword(s) in Shoes::Stack initialize: [:border]

Unexpected non-style keyword(s) in Shoes::Span initialize: [:fill]

Unexpected non-style keyword(s) in Shoes::Oval initialize: [:fill]

# MenuPanel is a Shoes::Widget -- need to figure out how Widgets should work
Unexpected non-style keyword(s) in MenuPanel initialize: [:width, :height]

So in each of those cases, we need to implement the property or figure out how it gets passed through (or whether it should.) We also need to make sure we're properly using init_args (now-current arg passing) for Stack, Flow and DocumentRoot.

Once all this is done, we can make unexpected keyword properties an error rather than a console print, which would be a very good thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant