Cmcmahon has uploaded a new change for review.
https://gerrit.wikimedia.org/r/171870
Change subject: QA: rubocop style updates
......................................................................
QA: rubocop style updates
Change-Id: I2dd63b0150f48620d7557c70ec73518af0d6e313
---
M .rubocop_todo.yml
M tests/browser/features/step_definitions/action_menu_permalink_steps.rb
M tests/browser/features/step_definitions/collapse_steps.rb
M tests/browser/features/step_definitions/flow_no_javascript_steps.rb
M tests/browser/features/step_definitions/flow_steps.rb
M tests/browser/features/step_definitions/lock_unlock_topics_steps.rb
M tests/browser/features/step_definitions/moderation_steps.rb
M tests/browser/features/step_definitions/reply_moderation_steps.rb
M tests/browser/features/step_definitions/sorting_topics_steps.rb
M tests/browser/features/step_definitions/thank_steps.rb
M tests/browser/features/support/env.rb
M tests/browser/features/support/pages/flow_old_permalink_page.rb
M tests/browser/features/support/pages/flow_page.rb
M tests/browser/features/support/pages/new_flow_page.rb
14 files changed, 34 insertions(+), 129 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/70/171870/1
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 0cf5a92..8a76932 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -31,107 +31,14 @@
Enabled: false
# Offense count: 1
-# Cop supports --auto-correct.
-Style/EmptyLines:
- Enabled: false
-
-# Offense count: 1
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
- Enabled: false
-
-# Offense count: 4
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles.
-Style/HashSyntax:
- Enabled: false
-
-# Offense count: 3
-# Cop supports --auto-correct.
-# Configuration parameters: Width.
-Style/IndentationWidth:
- Enabled: false
-
-# Offense count: 2
-# Cop supports --auto-correct.
-Style/LeadingCommentSpace:
- Enabled: false
-
-# Offense count: 1
-# Cop supports --auto-correct.
-Style/MethodCallParentheses:
- Enabled: false
-
-# Offense count: 2
-# Cop supports --auto-correct.
-Style/MultilineIfThen:
- Enabled: false
-
-# Offense count: 2
-# Cop supports --auto-correct.
-# Configuration parameters: AllowSafeAssignment.
-Style/ParenthesesAroundCondition:
- Enabled: false
-
-# Offense count: 3
-# Cop supports --auto-correct.
-# Configuration parameters: AllowAsExpressionSeparator.
-Style/Semicolon:
- Enabled: false
-
-# Offense count: 5
-# Cop supports --auto-correct.
-Style/SpaceAfterColon:
- Enabled: false
-
-# Offense count: 1
-# Cop supports --auto-correct.
-Style/SpaceAroundOperators:
- Enabled: false
-
-# Offense count: 2
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles.
-Style/SpaceBeforeBlockBraces:
- Enabled: false
-
-# Offense count: 2
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles,
EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
-Style/SpaceInsideBlockBraces:
- Enabled: false
-
-# Offense count: 6
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyleForEmptyBraces, SupportedStyles.
-Style/SpaceInsideHashLiteralBraces:
- EnforcedStyle: no_space
-
-# Offense count: 21
-# Cop supports --auto-correct.
-Style/SpaceInsideParens:
Enabled: false
# Offense count: 111
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/StringLiterals:
- Enabled: false
-
-# Offense count: 2
-# Cop supports --auto-correct.
-Style/Tab:
- Enabled: false
-
-# Offense count: 6
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle, SupportedStyles.
-Style/TrailingBlankLines:
- Enabled: false
-
-# Offense count: 2
-# Configuration parameters: EnforcedStyle, SupportedStyles.
-Style/VariableName:
Enabled: false
# Offense count: 1
diff --git
a/tests/browser/features/step_definitions/action_menu_permalink_steps.rb
b/tests/browser/features/step_definitions/action_menu_permalink_steps.rb
index 9cfe513..c43c0f8 100644
--- a/tests/browser/features/step_definitions/action_menu_permalink_steps.rb
+++ b/tests/browser/features/step_definitions/action_menu_permalink_steps.rb
@@ -1,7 +1,7 @@
When(/^I add (\d+) comments to the Topic$/) do |number|
number.to_i.times do
- @saved_random=Random.new.rand.to_s
- step 'I reply with comment "' + 'Selenium comment ' + @saved_random + '"'
+ @saved_random = Random.new.rand.to_s
+ step 'I reply with comment "' + 'Selenium comment ' + @saved_random + '"'
end
end
@@ -19,8 +19,8 @@
When(/^I go to an old style permalink to my topic$/) do
on(FlowPage) do |curPage|
- workflowId = curPage.flow_first_topic_element.attribute( 'data-flow-id' )
- visit(FlowOldPermalinkPage, :using_params => {:workflow_id => workflowId})
+ work_flow_id = curPage.flow_first_topic_element.attribute('data-flow-id')
+ visit(FlowOldPermalinkPage, using_params: { workflow_id: work_flow_id })
end
end
@@ -35,4 +35,4 @@
Then(/^the highlighted comment should contain the text for the 3rd comment$/)
do
expect(on(FlowPage).highlighted_post).to match @saved_random
-end
\ No newline at end of file
+end
diff --git a/tests/browser/features/step_definitions/collapse_steps.rb
b/tests/browser/features/step_definitions/collapse_steps.rb
index 37e9ae0..18b7231 100644
--- a/tests/browser/features/step_definitions/collapse_steps.rb
+++ b/tests/browser/features/step_definitions/collapse_steps.rb
@@ -26,17 +26,17 @@
on(FlowPage) do |page|
# If current_index is the array index, what must be clicked to
# get to the next one
- elementToClick = [
+ element_to_click = [
page.topics_only_view_element,
page.small_topics_view_element,
page.topics_and_posts_view_element
- ];
+ ]
- current_index = COLLAPSE_STRING_TO_INDEX[start_mode];
- current_mode = start_mode;
+ current_index = COLLAPSE_STRING_TO_INDEX[start_mode]
+ current_mode = start_mode
while current_mode != end_mode do
- elementToClick[current_index].when_visible.click
- current_index = ( current_index + 1 ) % elementToClick.length
+ element_to_click[current_index].when_visible.click
+ current_index = (current_index + 1) % element_to_click.length
current_mode = COLLAPSE_INDEX_TO_STRING[current_index]
end
end
@@ -64,4 +64,4 @@
Then(/^I should (.*) who started the first non-moderated topic$/) do
|visibility_str|
visibility_to_should(on(FlowPage).first_non_moderated_topic_starter_element,
visibility_str)
-end
\ No newline at end of file
+end
diff --git
a/tests/browser/features/step_definitions/flow_no_javascript_steps.rb
b/tests/browser/features/step_definitions/flow_no_javascript_steps.rb
index d10f567..1bd6084 100644
--- a/tests/browser/features/step_definitions/flow_no_javascript_steps.rb
+++ b/tests/browser/features/step_definitions/flow_no_javascript_steps.rb
@@ -2,11 +2,11 @@
# Using IE5 user agent which is currently blocked by ResourceLoader
user_agent = "Mozilla/4.0 (compatible; MSIE 5.5b1; Mac_PowerPC)"
@user_agent = user_agent
- @browser = browser(test_name(@scenario), {user_agent: user_agent})
+ @browser = browser(test_name(@scenario), { user_agent: user_agent })
$session_id = @browser.driver.instance_variable_get(:@bridge).session_id
end
-Given(/^I am on a Flow page without JavaScript$/ ) do
+Given(/^I am on a Flow page without JavaScript$/) do
visit(FlowPage)
end
diff --git a/tests/browser/features/step_definitions/flow_steps.rb
b/tests/browser/features/step_definitions/flow_steps.rb
index da2f5ae..a8ff8c8 100644
--- a/tests/browser/features/step_definitions/flow_steps.rb
+++ b/tests/browser/features/step_definitions/flow_steps.rb
@@ -28,7 +28,7 @@
on(FlowPage).usertools_block_user_link_element.when_not_visible
end
-Given(/^The Flow page is fully loaded$/ ) do
+Given(/^The Flow page is fully loaded$/) do
on(FlowPage).new_topic_body_element.when_not_visible
end
@@ -143,7 +143,7 @@
end
Then(/^the Save New Topic button should be disabled$/) do
- val = on(FlowPage).new_topic_save_element.attribute( "disabled" )
+ val = on(FlowPage).new_topic_save_element.attribute("disabled")
expect(val).to eq("true")
end
@@ -164,4 +164,4 @@
Then(/^the top post should not have a heading which contains "(.+)"$/) do
|text|
expect(on(FlowPage).flow_first_topic_heading).not_to match(text)
-end
\ No newline at end of file
+end
diff --git
a/tests/browser/features/step_definitions/lock_unlock_topics_steps.rb
b/tests/browser/features/step_definitions/lock_unlock_topics_steps.rb
index a35d3e9..2743e96 100644
--- a/tests/browser/features/step_definitions/lock_unlock_topics_steps.rb
+++ b/tests/browser/features/step_definitions/lock_unlock_topics_steps.rb
@@ -30,7 +30,7 @@
When(/^I type "(.*?)" as the reason$/) do |reason|
on(FlowPage) do |page|
- page.topic_lock_form_reason_element.when_present.clear()
+ page.topic_lock_form_reason_element.when_present.clear
# Focus textarea so that any menus that have been clicked lose their
focus. In Chrome these might disrupt the test as
# elements may be masked and not clickable.
page.topic_lock_form_reason_element.click
diff --git a/tests/browser/features/step_definitions/moderation_steps.rb
b/tests/browser/features/step_definitions/moderation_steps.rb
index 2587661..c642116 100644
--- a/tests/browser/features/step_definitions/moderation_steps.rb
+++ b/tests/browser/features/step_definitions/moderation_steps.rb
@@ -31,7 +31,7 @@
end
Then(/^I confirm$/) do
- on(FlowPage).confirm(true){}
+ on(FlowPage).confirm(true) {}
end
Then(/^I do not see the dialog box$/) do
diff --git a/tests/browser/features/step_definitions/reply_moderation_steps.rb
b/tests/browser/features/step_definitions/reply_moderation_steps.rb
index aa7ebe8..6d15f55 100644
--- a/tests/browser/features/step_definitions/reply_moderation_steps.rb
+++ b/tests/browser/features/step_definitions/reply_moderation_steps.rb
@@ -12,7 +12,7 @@
Then(/^the 3rd comment should be marked as hidden$/) do
on(FlowPage) do |page|
page.third_reply_element.when_present
- expect(page.third_reply_moderation_msg).to match( 'This comment was
hidden' )
+ expect(page.third_reply_moderation_msg).to match('This comment was hidden')
end
end
diff --git a/tests/browser/features/step_definitions/sorting_topics_steps.rb
b/tests/browser/features/step_definitions/sorting_topics_steps.rb
index 42a5963..eb8b18b 100644
--- a/tests/browser/features/step_definitions/sorting_topics_steps.rb
+++ b/tests/browser/features/step_definitions/sorting_topics_steps.rb
@@ -32,4 +32,3 @@
Then(/^the Flow page should show Newest topics link$/) do
expect(on(FlowPage).newest_topics_link_element.when_present).to be_visible
end
-
diff --git a/tests/browser/features/step_definitions/thank_steps.rb
b/tests/browser/features/step_definitions/thank_steps.rb
index 08bbe79..d448258 100644
--- a/tests/browser/features/step_definitions/thank_steps.rb
+++ b/tests/browser/features/step_definitions/thank_steps.rb
@@ -1,7 +1,7 @@
Given(/^the "(.*?)" page has a new unmoderated topic created by me$/) do
|title|
client = on(APIPage).client
client.log_in(ENV["MEDIAWIKI_USER"], ENV["MEDIAWIKI_PASSWORD"])
- client.action( 'flow', token_type: 'edit', submodule: 'new-topic', page:
title, nttopic:'Thank me please!', ntcontent: 'Hello' )
+ client.action('flow', token_type: 'edit', submodule: 'new-topic', page:
title, nttopic: 'Thank me please!', ntcontent: 'Hello')
end
Given(/^the most recent topic on "(.*?)" is written by another user$/) do
|title|
@@ -14,7 +14,7 @@
end
client.log_in(username, ENV["MEDIAWIKI_PASSWORD"])
- client.action( 'flow', token_type: 'edit', submodule: 'new-topic', page:
title, nttopic:'Thank me please!', ntcontent: 'Hello' )
+ client.action('flow', token_type: 'edit', submodule: 'new-topic', page:
title, nttopic: 'Thank me please!', ntcontent: 'Hello')
end
When(/^I click on the Thank button$/) do
diff --git a/tests/browser/features/support/env.rb
b/tests/browser/features/support/env.rb
index 7485b0e..55b30ce 100644
--- a/tests/browser/features/support/env.rb
+++ b/tests/browser/features/support/env.rb
@@ -1,10 +1,10 @@
require "mediawiki_api"
require "mediawiki_selenium"
-if ( ENV['PAGE_WAIT_TIMEOUT'] ) then
- PageObject.default_page_wait = ENV['PAGE_WAIT_TIMEOUT'].to_i
+if ENV['PAGE_WAIT_TIMEOUT']
+ PageObject.default_page_wait = ENV['PAGE_WAIT_TIMEOUT'].to_i
end
-if ( ENV['ELEMENT_WAIT_TIMEOUT'] ) then
- PageObject.default_element_wait = ENV['ELEMENT_WAIT_TIMEOUT'].to_i
-end
\ No newline at end of file
+if ENV['ELEMENT_WAIT_TIMEOUT']
+ PageObject.default_element_wait = ENV['ELEMENT_WAIT_TIMEOUT'].to_i
+end
diff --git a/tests/browser/features/support/pages/flow_old_permalink_page.rb
b/tests/browser/features/support/pages/flow_old_permalink_page.rb
index c1ab4d0..d550a27 100644
--- a/tests/browser/features/support/pages/flow_old_permalink_page.rb
+++ b/tests/browser/features/support/pages/flow_old_permalink_page.rb
@@ -2,6 +2,6 @@
include PageObject
include URL
- @params = {:page => 'Talk:Flow QA', :workflow_id => 'no workflow'}
- page_url URL.url( params[:page] ) + "?workflow=<%=params[:workflow_id]%>"
+ @params = { page: 'Talk:Flow QA', workflow_id: 'no workflow' }
+ page_url URL.url(params[:page]) + "?workflow=<%=params[:workflow_id]%>"
end
diff --git a/tests/browser/features/support/pages/flow_page.rb
b/tests/browser/features/support/pages/flow_page.rb
index 4854840..a0cdc72 100644
--- a/tests/browser/features/support/pages/flow_page.rb
+++ b/tests/browser/features/support/pages/flow_page.rb
@@ -13,7 +13,7 @@
form(:edit_header_form, css: ".flow-board-header-edit-view form")
textarea(:edit_header_textbox, css: ".flow-board-header-edit-view textarea")
- a(:author_link, css: ".flow-author a", index:0)
+ a(:author_link, css: ".flow-author a", index: 0)
a(:cancel_button, text: "Cancel")
# XXX (mattflaschen, 2014-06-24): This is broken; there is no
@@ -137,7 +137,7 @@
button(:change_title_save, css: ".flow-topic-titlebar form
.mw-ui-constructive")
### Post meta actions
- span(:post_meta_actions, css:".flow-post .flow-post-meta-actions", index: 0)
+ span(:post_meta_actions, css: ".flow-post .flow-post-meta-actions", index: 0)
a(:edit_post) do |page|
page.post_meta_actions_element.link_element(title: "Edit")
end
@@ -225,9 +225,8 @@
a(:recently_active_topics_link, text: "Recently active topics")
a(:newest_topics_choice, href: /topiclist_sortby=newest/)
-
## Watch and unwatch links
- div(:first_topic_watchlist_container, css: ".flow-topic-watchlist", index:0)
+ div(:first_topic_watchlist_container, css: ".flow-topic-watchlist", index: 0)
a(:first_topic_watch_link) do |page|
page.first_topic_watchlist_container_element.link_element(css:
".flow-watch-link-watch")
end
@@ -237,4 +236,4 @@
a(:board_unwatch_link, href: /Flow_QA&action=unwatch/)
a(:board_watch_link, href: /Flow_QA&action=watch/)
-end
\ No newline at end of file
+end
diff --git a/tests/browser/features/support/pages/new_flow_page.rb
b/tests/browser/features/support/pages/new_flow_page.rb
index 19a4695..16ed9c6 100644
--- a/tests/browser/features/support/pages/new_flow_page.rb
+++ b/tests/browser/features/support/pages/new_flow_page.rb
@@ -3,5 +3,5 @@
class NewFlowPage < FlowPage
include URL
# MEDIAWIKI_URL must have User_talk in $wgFlowOccupyNamespaces.
- page_url URL.url("User_talk:New page " + Array.new(8){[*'0'..'9', *'a'..'z',
*'A'..'Z'].sample}.join )
+ page_url URL.url("User_talk:New page " + Array.new(8) { [*'0'..'9',
*'a'..'z', *'A'..'Z'].sample }.join)
end
--
To view, visit https://gerrit.wikimedia.org/r/171870
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2dd63b0150f48620d7557c70ec73518af0d6e313
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits