== Information about you ==
**Name:** Lethexie(Xie Tao)
**Location:** Guangzhou, Guangdong, China (UTC+8:00)
**Typical working hours:** 16:00 - 22:00 (UTC+8:00)
== Synopsis ==
MdeiaWiki-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 ==
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**:
1. 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
2. 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**:
1. Unify naming rules for sniffs
2. Improve comment in sniffs
== Project Time Line ==
| **week** | **Duration** | **Description** |
|1 - 2 | 23 May - 6 June|Fix existing issues.|
|3 - 5 | 7 June - 28 June |Improve sniffs according to the code conventions and test it.|
|7 - 8 |29 June - 13 July |Add new code conventions, and implement sniffs. Then test it.|
|9 - 11 |14 July - 14 Aug |Add function/variable usage checking and test it.|
|12 - 13 |15 Aug - 23 Aug |Improve the source code of sniffs (unify file naming and comments).|
== Participation ==
**how you plan to communicate progress?**
Email and IRC.
**where you plan to publish your source code while you're working?**
**how and where you plan to ask for help?**
Google, IRC, Email, Phabricator.
== About you ==
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 ? weeks) on my graduation courseworks.
**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:**
**Please describe any relevant projects that you have worked on previously and what knowledge you gained from working on them (include links):**
1. Personal Management System for a student organization with hundreds of students (using CakePHP framework).
2. Organization account based on WeChat Public Platform with thousands of users (PHP, with a hand-crafted framework).
3. 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)