Bug#1041236: ruby-nokogiri: useless use of a variable in void context in version.rb

2023-08-06 Thread Richard Lewis
On Sun, 16 Jul 2023 10:37:15 +0100 Richard Lewis
 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



Bug#1041236: ruby-nokogiri: useless use of a variable in void context in version.rb

2023-07-16 Thread Richard Lewis
Package: ruby-nokogiri
Version: 1.13.10+dfsg-2+b1
Severity: normal
X-Debbugs-Cc: richard.lewis.deb...@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  racc1.6.2-1
ii  ruby1: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