summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-01-24 18:01:45 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-01-26 19:42:48 +0800
commit0bf918f05e827b380107d88f4592d1ceedd632f9 (patch)
tree8bf338da55c661dfb96e2d9e39d4c1a2f9ba5f18
parente042baebb81ebd2b60becd9bebd2d088881aeca4 (diff)
downloadgitlab-ce-0bf918f05e827b380107d88f4592d1ceedd632f9.tar.gz
Fix rubocop offenses. It's not checked before when
it's inside lib/tasks/*
-rw-r--r--.rubocop.yml4
-rw-r--r--lib/gitlab/task_helpers.rb9
2 files changed, 8 insertions, 5 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 563a00db6c0..4e80b49ccd2 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -19,6 +19,10 @@ AllCops:
- 'builds/**/*'
CacheRootDirectory: tmp
+# TODO: Remove me after updating gitlab-style
+Style/TrailingUnderscoreVariable:
+ Enabled: false
+
# Gitlab ###################################################################
Gitlab/ModuleWithInstanceVariables:
diff --git a/lib/gitlab/task_helpers.rb b/lib/gitlab/task_helpers.rb
index c1182af1014..34bee6fecbe 100644
--- a/lib/gitlab/task_helpers.rb
+++ b/lib/gitlab/task_helpers.rb
@@ -1,6 +1,7 @@
require 'rainbow/ext/string'
require 'gitlab/utils/strong_memoize'
+# rubocop:disable Rails/Output
module Gitlab
TaskFailedError = Class.new(StandardError)
TaskAbortedByUserError = Class.new(StandardError)
@@ -96,11 +97,9 @@ module Gitlab
end
def gid_for(group_name)
- begin
- Etc.getgrnam(group_name).gid
- rescue ArgumentError # no group
- "group #{group_name} doesn't exist"
- end
+ Etc.getgrnam(group_name).gid
+ rescue ArgumentError # no group
+ "group #{group_name} doesn't exist"
end
def gitlab_user