[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 Jul 16 10:37:15 BST 2023


Package: ruby-nokogiri
Version: 1.13.10+dfsg-2+b1
Severity: normal
X-Debbugs-Cc: richard.lewis.debian at googlemail.com

Dear Maintainer,

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.




-- System Information:
Debian Release: 12.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-10-amd64 (SMP w/1 CPU thread; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages ruby-nokogiri depends on:
ii  libc6               2.36-9
ii  libruby             1:3.1
ii  libruby3.1          3.1.2-7
ii  libxml2             2.9.14+dfsg-1.2
ii  libxslt1.1          1.1.35-1
ii  racc                1.6.2-1
ii  ruby                1:3.1
ii  ruby-mini-portile2  2.8.1-1
ii  ruby-pkg-config     1.5.1-1
ii  zlib1g              1:1.2.13.dfsg-1

ruby-nokogiri recommends no packages.

ruby-nokogiri suggests no packages.

-- no debconf information



More information about the Pkg-ruby-extras-maintainers mailing list