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>2023-01-09 15:07:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-01-09 15:07:31 +0300
commit1935f3e81b99c00697bf0b4d6a44d64068b34745 (patch)
treee2c42218945d0ae19c4566e844d4707513cc2fd6 /rubocop
parenta352bc8e72b948a834b0569d0d4288e95a9c529e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'rubocop')
-rw-r--r--rubocop/cop/gitlab/strong_memoize_attr.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/rubocop/cop/gitlab/strong_memoize_attr.rb b/rubocop/cop/gitlab/strong_memoize_attr.rb
index 8ef0f95e75b..0b3de9d7863 100644
--- a/rubocop/cop/gitlab/strong_memoize_attr.rb
+++ b/rubocop/cop/gitlab/strong_memoize_attr.rb
@@ -53,6 +53,9 @@ module RuboCop
# Don't flag methods with parameters.
return if send_node.each_ancestor(:def).first&.arguments&.any?
+ # Don't flag singleton methods.
+ return if send_node.each_ancestor(:defs).any?
+
corrector = autocorrect_pure_definitions(node.parent, body) if node.parent.def_type?
add_offense(send_node, &corrector)