Skip to content

[RUN ALL RSPEC] Use the last non-block arg for cop

Thong Kuah requested to merge fix_lint_last_block_arg into master

What does this MR do?

In Ruby, the explicit block argument is special, and for our case cannot be converted into a keyword argument. The argument we want instead is the last non-block argument.

Discovered from this imprecise warning in https://gitlab.com/gitlab-org/gitlab/-/jobs/936968115:

db/migrate/20190402150158_backport_enterprise_schema.rb:232:31: W: Lint/LastKeywordArgument: Using the last argument as keyword parameters is deprecated
    create_table(name, *args, &block)
                              ^^^^^^
Edited by Thong Kuah

Merge request reports

Loading