jenkins-bot has submitted this change and it was merged. Change subject: Update RuboCop to the latest version ......................................................................
Update RuboCop to the latest version Fixed offences recognised by the new version and updated RuboCop configuration according to recommendations. https://www.mediawiki.org/wiki/Manual:Coding_conventions/Ruby#Base_confi guration Change-Id: Ic6ae4487ac64eb2ecf1a589d801ae094535b5742 See: https://github.com/bbatsov/ruby-style-guide#percent-r Bug: T117983 --- M .rubocop.yml M .rubocop_todo.yml M Gemfile M Gemfile.lock M tests/browser/features/step_definitions/search_steps.rb M tests/browser/features/support/pages/search_results_page.rb 6 files changed, 38 insertions(+), 14 deletions(-) Approvals: Cindy-the-browser-test-bot: Looks good to me, but someone else must approve DCausse: Looks good to me, approved jenkins-bot: Verified diff --git a/.rubocop.yml b/.rubocop.yml index 130ea03..95daa1d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,4 +1,23 @@ inherit_from: .rubocop_todo.yml +AllCops: + StyleGuideCopsOnly: true + +# Uncomment when the offense is fixed +# Metrics/LineLength: +# Max: 100 + +Metrics/MethodLength: + Enabled: false + +Style/Alias: + Enabled: false + +Style/SignalException: + Enabled: false + Style/StringLiterals: EnforcedStyle: double_quotes + +Style/TrivialAccessors: + ExactNameMatch: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 640b948..493f9c5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,11 +1,12 @@ -# This configuration was generated by `rubocop --auto-gen-config` -# on 2014-08-29 12:48:37 -0400 using RuboCop version 0.25.0. +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2015-12-17 11:25:43 +0100 using RuboCop version 0.35.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 169 -# Configuration parameters: AllowURI. +# Offense count: 195 +# Configuration parameters: AllowURI, URISchemes. Metrics/LineLength: Max: 206 diff --git a/Gemfile b/Gemfile index 64081d5..fcc3d32 100644 --- a/Gemfile +++ b/Gemfile @@ -4,4 +4,4 @@ gem "mediawiki_selenium", "~> 0.3.0" gem "mimemagic", "~> 0.3.0" gem "parallel_tests", "~> 1.7.0" -gem "rubocop", "~> 0.26.1", require: false +gem "rubocop", "~> 0.35.1", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 0da3fd4..67c6b67 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -61,9 +61,9 @@ parallel (1.6.1) parallel_tests (1.7.0) parallel - parser (2.3.0.pre.2) + parser (2.2.3.0) ast (>= 1.1, < 3.0) - powerpack (0.0.9) + powerpack (0.1.1) rainbow (2.0.0) rest-client (1.8.0) http-cookie (>= 1.0.2, < 2.0) @@ -71,12 +71,13 @@ netrc (~> 0.7) rspec-expectations (2.99.2) diff-lcs (>= 1.1.3, < 2.0) - rubocop (0.26.1) + rubocop (0.35.1) astrolabe (~> 1.3) - parser (>= 2.2.0.pre.4, < 3.0) - powerpack (~> 0.0.6) + parser (>= 2.2.3.0, < 3.0) + powerpack (~> 0.1) rainbow (>= 1.99.1, < 3.0) - ruby-progressbar (~> 1.4) + ruby-progressbar (~> 1.7) + tins (<= 1.6.0) ruby-progressbar (1.7.5) rubyzip (1.1.7) selenium-webdriver (2.47.1) @@ -85,6 +86,7 @@ rubyzip (~> 1.0) websocket (~> 1.0) syntax (1.2.0) + tins (1.6.0) unf (0.1.4) unf_ext unf_ext (0.0.7.1) @@ -101,4 +103,4 @@ mediawiki_selenium (~> 0.3.0) mimemagic (~> 0.3.0) parallel_tests (~> 1.7.0) - rubocop (~> 0.26.1) + rubocop (~> 0.35.1) diff --git a/tests/browser/features/step_definitions/search_steps.rb b/tests/browser/features/step_definitions/search_steps.rb index 49b7f4b..9e65dc8 100644 --- a/tests/browser/features/step_definitions/search_steps.rb +++ b/tests/browser/features/step_definitions/search_steps.rb @@ -440,7 +440,7 @@ end Then(/^(.*) is suggested by api$/) do |text| fixed = @api_result["searchinfo"]["suggestionsnippet"] - fixed = fixed.gsub(/<em>(.*?)<\/em>/, '*\1*') unless fixed.nil? + fixed = fixed.gsub(%r{<em>(.*?)</em>}, '*\1*') unless fixed.nil? fixed.should == CGI.escapeHTML(text) end Then(/^(.*) is suggested$/) do |text| @@ -523,6 +523,7 @@ retry end end + # this name sucks def repeat_within(seconds, &block) end_time = Time.new + Integer(seconds) @@ -565,7 +566,7 @@ def check_api_highlight(key, index, highlighted, in_ok) expect(@api_result["search"].length).to be > index expect(@api_result["search"][index]).to have_key(key) - text = @api_result["search"][index][key].gsub(/<span class="searchmatch">(.*?)<\/span>/, '*\1*') + text = @api_result["search"][index][key].gsub(%r{<span class="searchmatch">(.*?)</span>}, '*\1*') if in_ok expect(text).to include(highlighted) else diff --git a/tests/browser/features/support/pages/search_results_page.rb b/tests/browser/features/support/pages/search_results_page.rb index 3dcde42..bd38126 100644 --- a/tests/browser/features/support/pages/search_results_page.rb +++ b/tests/browser/features/support/pages/search_results_page.rb @@ -62,6 +62,7 @@ get_highlighted_text(first_result_alttitle_wrapper_element) end end + # Note that this is really only useful if Warnings are being echod to the page. In testing environments they usually are. def warning text = @browser.text -- To view, visit https://gerrit.wikimedia.org/r/259650 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic6ae4487ac64eb2ecf1a589d801ae094535b5742 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: Zfilipin <[email protected]> Gerrit-Reviewer: Cindy-the-browser-test-bot <[email protected]> Gerrit-Reviewer: DCausse <[email protected]> Gerrit-Reviewer: Dduvall <[email protected]> Gerrit-Reviewer: Hashar <[email protected]> Gerrit-Reviewer: Zfilipin <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
