From 0bf918f05e827b380107d88f4592d1ceedd632f9 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Wed, 24 Jan 2018 18:01:45 +0800 Subject: Fix rubocop offenses. It's not checked before when it's inside lib/tasks/* --- .rubocop.yml | 4 ++++ lib/gitlab/task_helpers.rb | 9 ++++----- 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 -- cgit v1.2.1