Last modified: 2014-01-03 14:53:00 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59610, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57610 - Use snake_case for methods and variables
Use snake_case for methods and variables
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Quality Assurance (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
https://www.google-melange.com/gci/ta...
gci2013 https://www.mediawiki.org/wik...
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-26 18:54 UTC by Željko Filipin
Modified: 2014-01-03 14:53 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Željko Filipin 2013-11-26 18:54:35 UTC
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
Comment 1 Željko Filipin 2013-11-26 19:02:23 UTC
This is similar to bug #57597.
Comment 2 Željko Filipin 2013-11-26 19:06:03 UTC
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 3 Željko Filipin 2013-11-27 08:12:09 UTC
Leo Xiong, Google Code-in student has claimed the task:

https://www.google-melange.com/gci/task/view/google/gci2013/5259991820795904
Comment 4 Željko Filipin 2013-11-27 08:24:16 UTC
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 5 Željko Filipin 2013-11-27 08:31:23 UTC
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 6 Željko Filipin 2013-12-02 17:09:38 UTC
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 7 Gerrit Notification Bot 2013-12-13 22:34:48 UTC
Change 101054 had a related patch set uploaded by Aaron1011:
Use snake_case in Aliases

https://gerrit.wikimedia.org/r/101054
Comment 8 Gerrit Notification Bot 2013-12-17 11:54:01 UTC
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 9 Gerrit Notification Bot 2013-12-18 12:34:19 UTC
Change 100209 had a related patch set uploaded by Zfilipin:
Use snake case

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links