Page MenuHomePhabricator

MediaWiki Codesniffer not catching irrelevant characters after PHPDoc return types
Open, Needs TriagePublic

Description

This little thingy patch: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Popups/+/486294 reveals that CS for some reason doesn't catch trailing characters after the types for a PHPDoc @return annotation.

Cases like;

@return array/

should be caught by phpcs and make Jenkins to fail explicitly. @thiemowmde suggest we also tag this as good first task :)

Event Timeline

xSavitar created this task.Jan 24 2019, 3:08 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 24 2019, 3:08 PM

It is looking for punctations (regex class \p{P} which include \ when looking at https://www.fileformat.info/info/unicode/category/Po/list.htm

But this file is ending with 'Test.php' which is skipped in the FunctionComment sniff to avoid docs of test functions/classes

Setian added a subscriber: Setian.EditedFeb 23 2019, 7:31 AM

What documentation should a newbie read to learn how to do this? Oh, I guess I'll take a look at https://phabricator.wikimedia.org/project/profile/1087/ for inspiration.