Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-15 03:08:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-15 03:08:29 +0300
commit38b948a54e00841b51c446beb0adf079af60c963 (patch)
tree2e9dfe54e2d0ec444223f773dc283b1c639baae9 /rubocop
parent7f35b02e86cd3d2e8b4a81c5c3a8483ff6973c5a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'rubocop')
-rw-r--r--rubocop/cop/gitlab/json.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/rubocop/cop/gitlab/json.rb b/rubocop/cop/gitlab/json.rb
index d27c8dab66c..cf2ed0ba536 100644
--- a/rubocop/cop/gitlab/json.rb
+++ b/rubocop/cop/gitlab/json.rb
@@ -7,7 +7,7 @@ module RuboCop
extend RuboCop::Cop::AutoCorrector
MSG = <<~EOL
- Prefer `Gitlab::Json` over calling `JSON` or `to_json` directly. See https://docs.gitlab.com/ee/development/json.html
+ Prefer `Gitlab::Json` over calling `JSON` directly. See https://docs.gitlab.com/ee/development/json.html
EOL
AVAILABLE_METHODS = %i[parse parse! load decode dump generate encode pretty_generate].to_set.freeze
@@ -16,10 +16,6 @@ module RuboCop
(send (const {nil? | (const nil? :ActiveSupport)} :JSON) $_ $...)
PATTERN
- def_node_matcher :to_json_call?, <<~PATTERN
- (send $_ :to_json)
- PATTERN
-
def on_send(node)
method_name, arg_source = match_node(node)
return unless method_name
@@ -41,9 +37,6 @@ module RuboCop
return [method_name, arg_nodes.map(&:source).join(", ")]
end
- receiver = to_json_call?(node)
- return [:dump, receiver.source] if receiver
-
nil
end