diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-17 06:07:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-17 06:07:21 +0300 |
commit | bd37e94aecac7ef361a605bc1a5433415a4526cc (patch) | |
tree | 887c3bf3f833d88c2c3378ea9a1f31ee5698ae91 /rubocop | |
parent | 73c608b8c9e79319096fdbeb990dd5cb9ebf2b36 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'rubocop')
-rw-r--r-- | rubocop/cop/lint/last_keyword_argument.rb | 8 | ||||
-rw-r--r-- | rubocop/rubocop-ruby30.yml | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/rubocop/cop/lint/last_keyword_argument.rb b/rubocop/cop/lint/last_keyword_argument.rb index 3f5ad7e20d7..f50c25f7924 100644 --- a/rubocop/cop/lint/last_keyword_argument.rb +++ b/rubocop/cop/lint/last_keyword_argument.rb @@ -18,6 +18,8 @@ module RuboCop KEYWORD_DEPRECATION_STR = 'maybe ** should be added to the call' def on_send(node) + return if target_ruby_version >= 3.0 + arg = get_last_argument(node) return unless arg @@ -49,13 +51,13 @@ module RuboCop end def known_match?(file_path, line_number, method_name) - file_path_from_root = file_path.sub(File.expand_path('../../..', __dir__), '') - file_and_line = "#{file_path_from_root}:#{line_number}" - method_name = 'initialize' if method_name == 'new' return unless self.class.keyword_warnings[method_name] + file_path_from_root = file_path.sub(File.expand_path('../../..', __dir__), '') + file_and_line = "#{file_path_from_root}:#{line_number}" + self.class.keyword_warnings[method_name].any? do |warning| warning.include?(file_and_line) end diff --git a/rubocop/rubocop-ruby30.yml b/rubocop/rubocop-ruby30.yml index 6cd3f66ce55..b7634210e3d 100644 --- a/rubocop/rubocop-ruby30.yml +++ b/rubocop/rubocop-ruby30.yml @@ -14,3 +14,7 @@ Style/MutableConstant: Enabled: false Style/RedundantFreeze: Enabled: false + +# No longer needed because Ruby 3.0 will fail due to kwargs issues. +Lint/LastKeywordArgument: + Enabled: false |