Skip to content

Plugins expect different arguments for format method #313

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

Open
nixme opened this issue Feb 20, 2023 · 1 comment
Open

Plugins expect different arguments for format method #313

nixme opened this issue Feb 20, 2023 · 1 comment

Comments

@nixme
Copy link

nixme commented Feb 20, 2023

When using syntax_tree-rbs plugin (and it looks like others too), stree check will throw warnings (and error in the check rake task):

[warn] sig/merge_sitemaps.rbs
wrong number of arguments (given 3, expected 1..2)
.../vendor/bundle/ruby/3.2.0/gems/syntax_tree-rbs-0.5.1/lib/syntax_tree/rbs.rb:47:in `format'
.../vendor/bundle/ruby/3.2.0/gems/syntax_tree-6.0.0/lib/syntax_tree/cli.rb:136:in `run'
.../vendor/bundle/ruby/3.2.0/gems/syntax_tree-6.0.0/lib/syntax_tree/cli.rb:580:in `block (2 levels) in process_queue'

I believe this changed with a3c65df (included in versions 5.0.0 and greater).

The call to each formatter went from format(source, options.print_width) to format(source, options.print_width, options: options.formatter_options)

I'm happy make some PRs, but didn't know if you wanted to fix this is in each plugin, or for compatibility, check arity here in the main project and call appropriately.

@nixme nixme changed the title Plugins expect a different arguments for format method Plugins expect different arguments for format method Feb 20, 2023
@kddnewton
Copy link
Member

Oh no! Looks like you're right and I'm depending on an API that I really shouldn't be.

I think I'd like to include all of the various plugins in this project and check that they're working properly.

Thanks for opening the issue!

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

2 participants