Skip to content

Plugins expect different arguments for format method #313

Open
@nixme

Description

@nixme

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions