Fix Ruby compile time warnings
According to this script which runs ruby -wc
(Ruby 2.6.5p114 (2019-10-01 revision 67812)
) on the code base we have a couple of warnings which we can easily get rid of.
This issue tracks the progress.
Ideally, we should try to utilize RuboCop's
Fixes
-
!23074 (merged) - warning: '*' interpreted as argument
with✔ 👮 Lint/AmbiguousOperator
-
!23080 (merged) - warning: assigned but unused variable
🚫 👮 see !23080 (comment 271861210) -
!23165 (merged) - warning: character class has duplicated range
🚫 👮 -
!23269 (merged) - warning: possibly useless use of == in void context
-
!37440 (merged) - warning: assigned but unused variable
again - ...
Ignored warnings
Currently, this script ignores the following warnings:
-
warning: ambiguous first argument; put parentheses or a space even after
/' operator`- Too much noise for now. We could remove (and fix) this ignore later
👍
- Too much noise for now. We could remove (and fix) this ignore later
-
warning: possibly useless use of \| in void context
- We cannot avoid this warnings in specs when
RSpec::Parameterized::TableSyntax
used. Example: https://gitlab.com/gitlab-org/gitlab/blob/350bb25818e2bc08be1358036f9f4df427fbd75f/spec/models/issue_spec.rb#L815
- We cannot avoid this warnings in specs when
Edited by Peter Leitzen