The Wayback Machine - https://web.archive.org/web/20160623084629/https://phabricator.wikimedia.org/T59610

Use snake_case for methods and variables
Closed, ResolvedPublic

Description

Methods in Ruby code should use snake_case for methods and variables.

That follows advice from Github Ruby Styleguide[1], Naming section: "Use snake_case for methods and variables."

The most occurrences of CamelCase are in Wikibase repository, example from alias_module.rb[2]:

div(:aliasesDiv, class: "wb-aliases")

it should be:

div(:aliases_div, class: "wb-aliases")

  1. https://github.com/styleguide/ruby

2: https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/selenium_cuc/features/support/modules/alias_module.rb#L12


Version: unspecified
Severity: normal
Whiteboard: gci2013 https://www.mediawiki.org/wiki/Google_Code-In#Candidate_tasks
URL: https://www.google-melange.com/gci/task/view/google/gci2013/5259991820795904

Details

Reference
bz57610
bzimport set Reference to bz57610.
bzimport added a subscriber: Unknown Object (MLST).
Comment Actions

This is similar to bug #57597.

Comment Actions

What needs to be done?

#1 clone repositories listed here: https://github.com/wikimedia/mediawiki-selenium#links (use "Gerrit" link, not "GitHub" link)

#2 inspect all Ruby files (.rb) in the repository

#3 replace CamelCase with snake_case

If you have any questions, ask.

Comment Actions

After you make the change, check syntax of all Ruby files in a repository with this (if you are on Mac/Linux):

find . -name "*.rb" -exec ruby -wc {} \;

Comment Actions

CamelCase should still be used for classes and modules, do not change those. For example, this should not be changed (from alias_module.rb[1]):

module AliasPage

include PageObject
...
end

end

If you have any questions, please ask here (leave a comment) at #wikimedia-qa freenode IRC channel, or at QA mailing list[2].

1: https://github.com/wikimedia/mediawiki-extensions-Wikibase/blob/master/selenium_cuc/features/support/modules/alias_module.rb#L9-L10
2: https://lists.wikimedia.org/mailman/listinfo/qa

Comment Actions

If you need more information (and you probably do), feel free to ask questions
here, at #wikimedia-qa freenode IRC channel or at QA mailing list:

https://lists.wikimedia.org/mailman/listinfo/qa

Comment Actions

Change 101054 had a related patch set uploaded by Aaron1011:
Use snake_case in Aliases

https://gerrit.wikimedia.org/r/101054

Comment Actions

Change 101054 abandoned by Zfilipin:
Use snake_case in Aliases

Reason:
Changes made to files in /selenium folder are out of scope for this Google Code-in task. I have made a few changes to this commit, that is in scope for the task:

https://gerrit.wikimedia.org/r/#/c/100209/

https://gerrit.wikimedia.org/r/101054

Comment Actions

Change 100209 had a related patch set uploaded by Zfilipin:
Use snake case

https://gerrit.wikimedia.org/r/100209

Add Comment

Morty Proxy This is a proxified and sanitized view of the page, visit original site.