[DRE-maint] Bug#1041236: ruby-nokogiri: useless use of a variable in void context in version.rb
Richard Lewis
richard.lewis.debian at googlemail.com
Sun Aug 6 17:56:28 BST 2023
On Sun, 16 Jul 2023 10:37:15 +0100 Richard Lewis
<richard.lewis.debian at googlemail.com> wrote:
> When loading nokogiri, with 'ruby -w' i get a warning
> /usr/lib/x86_64-linux-gnu/rubygems-integration/3.1.0/gems/nokogiri-1.13.10/lib/nokogiri/version/info.rb:85: warning: possibly useless use of a variable in void context
>
> The relevent lines are
>
> 72 def warnings
> 73 warnings = []
> # ... other code adding to warnings is versions mismatch
> 85 warnings
> 86 #Debian: ignore warnings from mismatching build/load versions
> 87 []
> 88 end
>
> So it looks like Debian has made the function return an empty list instead of the 'warnings'
> variable, but has left 85 as a useless use of a variable.
>
> Assuming there is a reason for hiding those warnings, I think it would be better to change
> line 85 to say 'warnings=[]' and then the function would returning a now empty warnings message:
> but ruby wouldnt complain.
Please see the following MR which does this - untested, but the
autopkgtests pass
https://salsa.debian.org/ruby-team/ruby-nokogiri/-/merge_requests/1
More information about the Pkg-ruby-extras-maintainers
mailing list