Skip to content

Model::Lookup::find_object_location(): only pass the expected three substitution arguments to sprintf()

Marek Szuba requested to merge bugfix/lookup_sprintf_redundant_args into master

Created by: mkszuba

Description

Make sure that the sprintf() call in line 350 of lib/EnsEMBL/REST/Model/Lookup.pm doesn't receive more than the 3 substitution arguments it expects.

Use case

Previously said sprintf() call was passed the entire @captures array and at least nowadays that array is longer than 3 elements, resulting in a "redundant arguments" warning which spams the output of the test suite.

Benefits

Less noise in test output.

Possible Drawbacks

None I can think of.

Testing

Have you added/modified unit tests to test the changes?

Yes, archive.t - the first test file to have previously produced this warning - now uses Test::Warnings. Note that this adds a new test-time dependency to ensembl-rest, which however shouldn't be a problem because other Ensembl repositories already depend on Test::Warnings.

If so, do the tests pass/fail?

The test passes i.e. no warnings are detected.

Have you run the entire test suite and no regression was detected?

Yes, no regression detected. The errors in archive.t are the same as before with the bugfix branch based on master and gone when based on the branch of #374.

Merge request reports