diff options
author | Peter Leitzen <pleitzen@gitlab.com> | 2019-08-26 15:24:25 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-08-26 15:24:25 +0300 |
commit | e101a26444f0f02df2c6301f13bc1f3e20781f8b (patch) | |
tree | d745ac1b2f29ae5eb656c5b597e00343d645c5d4 /rubocop/cop/gitlab | |
parent | 9e48f7079b648e427d24083af19c3f670cda3206 (diff) |
Utilize RuboCop's Include/Exclude config
Stop checking the file location programmatically.
Diffstat (limited to 'rubocop/cop/gitlab')
-rw-r--r-- | rubocop/cop/gitlab/httparty.rb | 6 | ||||
-rw-r--r-- | rubocop/cop/gitlab/union.rb | 4 |
2 files changed, 1 insertions, 9 deletions
diff --git a/rubocop/cop/gitlab/httparty.rb b/rubocop/cop/gitlab/httparty.rb index 215f18b6993..8acebff624d 100644 --- a/rubocop/cop/gitlab/httparty.rb +++ b/rubocop/cop/gitlab/httparty.rb @@ -1,11 +1,9 @@ -require_relative '../../spec_helpers' +# frozen_string_literal: true module RuboCop module Cop module Gitlab class HTTParty < RuboCop::Cop::Cop - include SpecHelpers - MSG_SEND = <<~EOL.freeze Avoid calling `HTTParty` directly. Instead, use the Gitlab::HTTP wrapper. To allow request to localhost or the private network set @@ -27,8 +25,6 @@ module RuboCop PATTERN def on_send(node) - return if in_spec?(node) - add_offense(node, location: :expression, message: MSG_SEND) if httparty_node?(node) add_offense(node, location: :expression, message: MSG_INCLUDE) if includes_httparty?(node) end diff --git a/rubocop/cop/gitlab/union.rb b/rubocop/cop/gitlab/union.rb index 09541d8af3b..c44c847657b 100644 --- a/rubocop/cop/gitlab/union.rb +++ b/rubocop/cop/gitlab/union.rb @@ -1,5 +1,4 @@ # frozen_string_literal: true -require_relative '../../spec_helpers' module RuboCop module Cop @@ -7,8 +6,6 @@ module RuboCop # Cop that disallows the use of `Gitlab::SQL::Union`, in favour of using # the `FromUnion` module. class Union < RuboCop::Cop::Cop - include SpecHelpers - MSG = 'Use the `FromUnion` concern, instead of using `Gitlab::SQL::Union` directly' def_node_matcher :raw_union?, <<~PATTERN @@ -17,7 +14,6 @@ module RuboCop def on_send(node) return unless raw_union?(node) - return if in_spec?(node) add_offense(node, location: :expression) end |