Information about you
Name: Lethexie(Xie Tao)
Email: xietaoecho@gmail.com
IRC: FreeNode/#wikimedia-dev/Lethexie
Location: Guangzhou, Guangdong, China (UTC+8:00)
Typical working hours: 16:00 - 22:00 (UTC+8:00)( 6 hours a day)
Synopsis
MediaWiki-CodeSniffer is a linting tool based on PHP_CodeSniffer. It helps MediaWiki to improve its code quality. This proposal aims to fix existing issues in the project, complete linting rules, add supports for checking functions usages and standardize sniffs.
Possible mentors: @Addshore, @EBernhardson, @Legoktm
Pros: It helps us to improve our code quality, make the source code of MediaWiki project more reliable.
Deliverables
Project details
Now MediaWiki-CodeSniffer has already implemented some helpful linting rules and coding convention rules. But there are some places we can improve:
For code sniffing:
- Some of our sniffs are imperfect:
- Cannot recognize illegal format in comment like /*** fail ***/
- Doesn’t give warnings to function or variable namings using lower camel case
- Unexpected empty line shows up after fixing the open brace of a function
- Fail to check if the code use PHP superglobals (like $_GET, $_POST, etc)
- A newline expected before a single line comment
- Brace should be placed on the same line as the start of class
- We can add some rules for linting the usage of functions and variables like:
- Usage of $dbr->query() directly instead of the $dbr->select() wrapper
- Using wfMessage() when $this->msg() is usable
- Using globals ($wgUser, $wgRequest) when their context equivalents could be used instead ($this->getUser(), $this->getRequest())
- Modifying certain globals ($wgUser, $wgResourceModules, etc) inside a $wgExtensionFunction where it is either too early or late to do so
- Avoid to use deprecated classes,functions,variables
For the source code of sniffs:
- Unify naming rules for sniffs
- Improve comment in sniffs
Project Time Line
23 May - 30 May
- Clean up the current code
- Recheck all of sniffer
31 May - 7 June
- illegal format in comment like /*** fail ***/
8 June - 15 June
- Unexpected empty line shows up after fixing the open brace of a function
- give warnings to function or variable namings using lower camel case
16 June - 23 June
- check if the code use PHP superglobals (like $_GET, $_POST, etc)
- A newline expected before a single line comment
24 June - 1 July
- Brace should be placed on the same line as the start of class
- Contruct array of configures
2 July - 9 July
- Classify the type of functions and class
- Using globals ($wgUser, $wgRequest) when their context equivalents could be used instead ($this->getUser(), $this->getRequest())
10 July - 17 July
- Using wfMessage() when $this->msg() is usable
- List the important deprecated classes,functions,variables
18 July - 25 July
- Modifying certain globals ($wgUser, $wgResourceModules, etc) inside a $wgExtensionFunction where it is either too early or late to do so
25 July - 1 Aug
- Avoid to use deprecated classes,functions,variables
2 Aug - 9 Aug
- Unify naming rules for sniffs
- Improve comment in sniffs
10 Aug - 17 Aug
- Recheck all the new features
- Necessary documents
Participation
how you plan to communicate progress?
Email and IRC.
where you plan to publish your source code while you're working?
Gerrit.
how and where you plan to ask for help?
Google, IRC, Email, Phabricator.
About you
Education:
Undergraduate student in South China University of Technology 2012 - 2016
How did you hear about this program?
I heard about it from my friends.
Will you have any other time commitments, such as school work, another job, planned vacation, etc., during the duration of the program?
I need to spend some times (about 2 week) on my graduation courseworks in the first 2 weeks, this is the reason I do some easy work in the above time line.
We advise all candidates eligible to Google Summer of Code and Outreachy (previously known as FOSS Outreach Program for Women) to apply for both programs. Are you planning to apply to both programs and, if so, with what organization(s)?
I apply for the GSoC 2016.
We don't just care about your project -- you are a person, and that matters to us! What drives you? What makes you want to make this the most awesomest wiki enhancement ever?
I’d like to spend some times on FOSS, and I think the MediaWiki is a great choice.
You don't need to write out your life story (we can read your blog if we want that), but we want to know a little about what makes you tick. Are you a Wikipedia addict wanting to make your own experience better? Did a wiki with usability problems run over your dog, and you're seeking revenge? :-) What does making this project happen mean to you?
Wikipedia has already helped me saved a lot of time from reading dull and scattered documents. It usually offer great value to solve my problems. Also, the MediaWiki project created a great Wiki system (MediaWiki), and I am willing to make it better and easier for hacking it. BTW, It’s cool to be a developer of MediaWiki ;-)
Past experience
Please describe your experience with any other FOSS projects as a user and as a contributor:
None.
Please describe any relevant projects that you have worked on previously and what knowledge you gained from working on them (include links):
- Personal Management System for a student organization with hundreds of students (using CakePHP framework).
- Organization account based on WeChat Public Platform with thousands of users (PHP, with a hand-crafted framework).
- Inner System for a custom clearance company (PHP).
By working on projects above, I have improved my ability of analyzing requirements as well as developing and enhancing a PHP project.
What project(s) are you interested in (these can be in the same or different organizations)?
Improving static analysis tools for MediaWiki in MediaWiki-CodeSniffer , see https://phabricator.wikimedia.org/T89682
Do you have any past experience working in open source projects (MediaWiki or otherwise)? If so, tell us about it! If you have already written a feature or bugfix in a Wikimedia technology such as MediaWiki, link to it here; we will give strong preference to candidates who have done so.
I have read the project source code from the Git, and I written some changes as following:
https://phabricator.wikimedia.org/T129231 (patch for review)
https://phabricator.wikimedia.org/T129840 (patch for review)
https://phabricator.wikimedia.org/T130004 (patch for review)
https://phabricator.wikimedia.org/T129313 (patch for review)
Gerrit:
https://gerrit.wikimedia.org/r/#/c/275747/
https://gerrit.wikimedia.org/r/#/c/275796/
https://gerrit.wikimedia.org/r/#/c/276110/
https://gerrit.wikimedia.org/r/#/c/277227/