diff options
author | Robert Speicher <robert@gitlab.com> | 2016-05-30 17:59:10 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-05-30 17:59:10 +0000 |
commit | e7586cfbdc6a77b5771bea38a9ee3a9c17cdd37a (patch) | |
tree | 8c18de2755646c8e60c4554cf66d6475898b690f /config | |
parent | ea329376302bac3bd49244ad043fa8adeb1d002e (diff) | |
parent | a55e8f109fbaec1bb2db19a37a6537d8833c995c (diff) | |
download | gitlab-ce-e7586cfbdc6a77b5771bea38a9ee3a9c17cdd37a.tar.gz |
Merge branch 'rubocop/enable-negatedif-style-cop' into 'master'
Enable Style/NegatedIf Rubocop cop
Favor `unless` over `if` for negative conditions (or control flow ||).
```ruby
# bad
do_something if !some_condition
# bad
do_something if not some_condition
# good
do_something unless some_condition
# good
some_condition || do_something
```
See #17478
See merge request !4355
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/1_settings.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 124d63ce3ac..436751b9d16 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -52,7 +52,7 @@ class Settings < Settingslogic # check that values in `current` (string or integer) is a contant in `modul`. def verify_constant_array(modul, current, default) values = default || [] - if !current.nil? + unless current.nil? values = [] current.each do |constant| values.push(verify_constant(modul, constant, nil)) |