Commit graph

53 commits

Author SHA1 Message Date
Umherirrender
cdd1fa84d0 Do not use broken bootstrap in phpcs.xml
The bootstrap in mediawiki-codesniffer is broken, because it was not
adjust when PHP CodeSniffer Version 3.0.0 was used. Remove the broken
bootstap.

Bug: T172933
Change-Id: I29e776662055077f6de3a9bc6d0869120b387ea7
2017-08-12 11:07:07 +02:00
Umherirrender
718e63694d Add missing @param and @return documentation
Change-Id: I1d1098eec3933df6561cceef646576013ddc08c8
2017-08-11 22:17:01 +02:00
Umherirrender
ace44e2064 Use correct variable name in @param documentation
For some varargs a variable name is added with suffix ,... as seen for
many other varargs

Some @param are swapped, because there are in the wrong order

Enable Sniff MediaWiki.Commenting.FunctionComment.ParamNameNoMatch

Change-Id: I60fec6025bce824d5c67563ab7b65ad6cd628ad8
2017-08-11 19:27:19 +02:00
Umherirrender
43e8cd0579 Make phpcs pass
Reenable MediaWiki.WhiteSpace.SpaceBeforeClassBrace.NoSpaceBeforeBrace,
because the mentioned bug is fixed

Bug: T172933
Change-Id: I1593bdba2295ebed401b921f2beabed69dba7638
2017-08-11 16:22:42 +02:00
Kunal Mehta
d1cf48a397 build: Update mediawiki/mediawiki-codesniffer to 0.10.1
And auto-fix all errors.

The `<exclude-pattern>` stanzas are now included in the default ruleset
and don't need to be repeated.

Change-Id: I928af549dc88ac2c6cb82058f64c7c7f3111598a
2017-07-22 18:24:09 -07:00
Reedy
de5e6e6669 phpcs.xml: Escape . in exclude-pattern
And fix errors in a file that was previously being excluded.

Bug: T129664
Change-Id: I60161b4037ca122ccd2f0730a4b4aa59d878e459
2017-07-23 00:46:12 +00:00
Reedy
bf05883808 Update mediawiki/mediawiki-codesniffer to 0.8.1
Change-Id: I7ac436521fcba3fa9ae8775fcf589a06ddcadd9e
2017-07-05 21:04:46 +00:00
Umherirrender
b5cddfb27b Remove empty lines at begin of function, if, foreach, switch
Organize phpcs.xml a bit

Change-Id: Ifb767729b481b4b686e6d6444cf48b1f580cc478
2017-07-01 11:34:16 +00:00
jenkins-bot
b3f0a59256 Merge "Remove space after cast" 2017-06-29 01:11:32 +00:00
Umherirrender
9cd5a3fccf clone keyword must not be used as a function
Also changed a require_once

Change-Id: Ib8030ea5320a62ee4f114d8d506382c5665e3e02
2017-06-28 16:29:33 +02:00
Umherirrender
6c069e37b2 Remove space after cast
One remaining file was fixed

Change-Id: I95f77028219046e14c887cd2e0d5f6ffe98b9cd8
2017-06-27 20:13:04 +02:00
Umherirrender
be42e09aa8 build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0
The used phpcs has a bug, so the version 0.9.0 could not be enforced at the moment.
Will be fixed in next version, see T167168

Changed:
- Remove duplicate newline at end of file
- Add space between function and ( for closures
- and -> &&, or -> ||

Change-Id: I4172fb08861729bccd55aecbd07e029e2638d311
2017-06-26 17:14:31 +00:00
Baha
0b5afb7f05 phpcs: Allow linting tools to discover rules
Explicitly stating the current directory fixes the ambiguity
of finding the ruleset referred to in the file. This allows
syntax checkers like flycheck (for GNU Emacs) to work.

Change-Id: I6b046db29d11aff514d8f3623d049f5b6231a9d4
2017-06-05 20:08:44 +00:00
Kunal Mehta
a49905838f phpcs: Run MediaWiki.Commenting.FunctionComment.WrongStyle sniff
All files in the repository currently pass.

Change-Id: I5549abfe8374ae4b6f8904c2d7870ea77b8ee17c
2017-05-06 12:45:42 -07:00
Paladox
484617661d Update mediawiki/mediawiki-codesniffer to 0.8.0
Change-Id: I11c4e0e519589c2d005896bf9d3758ef017346fb
2017-05-06 12:26:16 -07:00
Brad Jorsch
a46ab3d9ed Have phpcs skip local configuration files
There's little point in phpcs checking LocalSettings.php or the other
*.php files in .gitignore.

Change-Id: Ibea15a3f3a7bfe2571e253ba9e19c1d91dfddeff
2016-11-22 13:13:52 -05:00
Timo Tijhof
b3607bf2e5 build: Ignore phpcs in /skins but not /includes/skins
Since the match can be case-insensitive (apparently), this meant
ExtensionsTestSuite.php ("extensions") wasn't being validated either.

Bug: T127238
Change-Id: I679de924ebeb45150004783ce404fac92af026a7
2016-03-04 15:50:03 +00:00
Kunal Mehta
b9668d6d80 build: Update mediawiki-codesniffer to 0.6.0, add "composer fix"
* Fix errors spotted by new release
* Introduce "composer fix", which uses phpcbf to automatically fix some
errors spotted by phpcs.
* Drop $PHPCS_ARGS variable that didn't work on Windows, and add -s flag
* Remove rules from phpcs.xml that are now in MW-CS ruleset.

Change-Id: I13e2155695918c918b67497ac65b85a03897095e
2016-02-17 02:54:42 -08:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Paladox
2b61957cfe build: Update mediawiki/mediawiki-codesniffer to 0.5.1
Two rules are ignored for now to allow us to upgrade:
* MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures
* Generic.ControlStructures.InlineControlStructure.NotAllowed

Also ignore the .git folder.

Change-Id: I1b149c72b27be54e22e369999ad0c41c2d1fc2b4
2016-01-02 09:50:09 +00:00
Reedy
56cfe8956c Re-enable last phpcs rule
Bug: T102609
Change-Id: I49eb778ccb5f0a3662fe4573872d1235c52fdd81
2015-10-14 17:08:50 +00:00
umherirrender
6f8805e4c9 Enable Squiz.Classes.ValidClassName.NotCamelCaps
Change-Id: Ie413b403992ba8598b3dea03adc9733c30414fe9
2015-10-10 17:33:23 +00:00
umherirrender
f1da0a7431 Enable PSR2.Methods.MethodDeclaration.Underscore
Whitelist StubObject because the underscore is for internal use.

Change-Id: I4beeee8df8cde079b810a372539e3c169e80f2d3
2015-10-06 16:56:56 +00:00
Amir E. Aharoni
1701d9b402 Reenable LineLength phpcs check
Bug: T102614
Change-Id: If853510b55d787765a84bac22b2dbff2e6c526c0
2015-10-06 16:06:22 +03:00
umherirrender
d9f0515123 Enable MediaWiki.NamingConventions.PrefixedGlobalFunctions.wfPrefix
Should work after Ie094f78781b2d6f7af1a0f1eea1f7ea4d0b9c69c

Bug: T104501
Change-Id: I1e3e8a1480b822272c762f2771d8554980c32c1b
2015-10-03 18:37:52 +00:00
umherirrender
a60c09d3b0 Enable Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed
All remaining lines should be fixed now

Bug: T113854
Change-Id: I85269d4c84ae3a676a773e24b0a96a4e7a89ac38
2015-10-03 18:22:55 +00:00
Vivek Ghaisas
5e53c006b7 Re-enable WhiteSpace.SpaceBeforeSingleLineComment sniff
Enable only the SingleSpaceBeforeSingleLineComment part, not the
EmptyComment part.

Change-Id: I98f2d6d401745d8aaacaca115789eb15b81c6813
2015-09-27 05:13:44 +05:30
Reedy
b547b16790 Disable EmptyComment and SingleSpaceBeforeSingleLineComment code sniffers
Lots of warnings to be fixed in core

Change-Id: I9041ead57c2225cd618501d4998ceb85e9cb3c1b
2015-09-26 23:37:27 +01:00
Vivek Ghaisas
c11efd3d95 Add ignoreList for valid global variable name sniff in phpcs.xml
The list of variables to ignore was hardcoded in the sniff. Moving it to
the phpcs.xml file allows setting it on a per-project basis, and hence,
should be set in core's phpcs.xml.

Bug: T104501
Change-Id: I6909b1d3845ba72d867fe01e86bd4a8f6bef198f
2015-09-27 03:19:46 +05:30
Vivek Ghaisas
88ffd6d422 Add ignoreList for prefixed functions sniff in phpcs.xml
Certain unprefixed global functions have been in the codebase from a
long time and prefixing them could cause errors. The prefixed functions
sniff allows an ignoreList to be set in phpcs.xml.

Bug: T104501
Change-Id: Ie094f78781b2d6f7af1a0f1eea1f7ea4d0b9c69c
2015-09-27 03:19:46 +05:30
Reedy
8882634112 Re-enable MediaWiki.WhiteSpace.SpaceAfterControlStructure.Incorrect
Change-Id: I1b756909a1080108c5147d46950f826871ef6dc1
2015-09-26 18:32:32 +01:00
jenkins-bot
8afb099b5b Merge "Re-enable Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed" 2015-09-26 17:05:49 +00:00
jenkins-bot
4ad0cdad5e Merge "Re-enable Squiz.WhiteSpace.SemicolonSpacing.Incorrect" 2015-09-26 17:01:07 +00:00
jenkins-bot
c3a5d76d19 Merge "Re-enable MediaWiki.WhiteSpace.SpaceyParenthesis.SingleSpaceBeforeCloseParenthesis" 2015-09-26 16:53:03 +00:00
Reedy
355e58da2f Re-enable Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
Change-Id: I07b4043163e5d00709f72dbbb3e2a46b17414d1c
2015-09-26 17:45:29 +01:00
Reedy
062af78957 Re-enable Squiz.WhiteSpace.SemicolonSpacing.Incorrect
Change-Id: Ie86c512fbca07f41b252d95de3ab92da3a050e72
2015-09-26 17:41:22 +01:00
jenkins-bot
986d426de7 Merge "Re-enable Squiz.WhiteSpace.ScopeClosingBrace.Indent" 2015-09-26 16:39:22 +00:00
Reedy
8e8368ca65 Re-enable MediaWiki.WhiteSpace.SpaceyParenthesis.SingleSpaceBeforeCloseParenthesis
Change-Id: I8482f5dd9d79e4946e862b0ac03bd027d62e8646
2015-09-26 17:38:35 +01:00
Reedy
0ea1898b4e Re-enable MediaWiki.WhiteSpace.SpaceyParenthesis.SingleSpaceAfterOpenParenthesis
Fixed some SingleSpaceBeforeCloseParenthesis too

Change-Id: I1695c706a9b23ab98074ff7d6a3687eb5cdce6e7
2015-09-26 16:13:12 +00:00
Reedy
3a6fc5e96c Re-enable Squiz.WhiteSpace.ScopeClosingBrace.Indent
Change-Id: I743c4ce019321d631c0a11ee2112fe9aa8ba4c5d
2015-09-26 16:09:54 +00:00
Reedy
94c01868b2 Re-enable PSR2.Methods.MethodDeclaration.AbstractAfterVisibility
Change-Id: I50a987edf03cb19bfd707cd00c143c3665eba94f
2015-09-26 16:30:43 +01:00
jenkins-bot
ad2a484630 Merge "Re-enable PSR2.Namespaces.NamespaceDeclaration.BlankLineAfter" 2015-09-26 15:28:00 +00:00
jenkins-bot
dd3c4f3a6f Merge "Re-enable Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" 2015-09-26 15:20:18 +00:00
jenkins-bot
831fdbea37 Merge "Re-enable PSR2.Methods.MethodDeclaration.StaticBeforeVisibility" 2015-09-26 15:19:16 +00:00
Reedy
abfe13dfe8 Re-enable PSR2.Namespaces.NamespaceDeclaration.BlankLineAfter
Change-Id: I39f71dde31f3ec18ab06904692f6a4ffd454d4d1
2015-09-26 15:17:57 +00:00
jenkins-bot
2e6f2116e6 Merge "Re-enable Generic.Files.EndFileNewline.NotFound" 2015-09-26 15:14:24 +00:00
Reedy
baa8875537 Re-enable PSR2.Methods.MethodDeclaration.StaticBeforeVisibility
Change-Id: Id3e4bc5d7e4d1b8003f9f6b324e2321b5af1771f
2015-09-26 16:02:57 +01:00
Reedy
0b3e3b7622 Re-enable Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines
Add extra whitespace line too

Change-Id: Ia33c9b63c36f121e5e9283c6d4a2b024a1821a43
2015-09-26 16:00:56 +01:00
Reedy
776c865077 Re-enable Generic.Files.EndFileNewline.NotFound
Change-Id: Ib84ce8dc973f7e3fe688435a72f7936342b6f2dd
2015-09-26 15:58:53 +01:00
Reedy
ca4c290082 Re-enable MediaWiki.VariableAnalysis.UnusedGlobalVariables
Globals are used in included file, so ignore warning in this case

Change-Id: I50315425827cc49eac3ca943a5a8952d0292ce23
2015-09-26 15:51:52 +01:00