Commit graph

38 commits

Author SHA1 Message Date
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
Kunal Mehta
a49a8e7f09 phpcs: Disable failing sniffs in phpcs.xml
This allows us to make PHPCS voting, and enable the failing rules
individually when once their issues are fixed.

Bug: T102609
Change-Id: I6731d2d07bbd89d424a660ceb7aee4c0392500d3
2015-09-26 13:27:45 +00:00
Vivek Ghaisas
d924723732 Ignore languages/messages/Messages*.php in line length sniff
Most of these files have very long lines, but that makes them easier to
read. Also, they're generated from a script. It's probably a better idea
to ignore their lengths than to change the lengths.

Bug: T103806
Change-Id: Ic6860520e4cc76f93aa13c364aae11cf14f279d0
2015-09-01 14:09:12 +00:00
Kunal Mehta
802ddf598e build: Move PHPCS configuration to phpcs.xml
"composer phpcs" now runs PHPCS against the relevant directories.

Change-Id: Ic28eaff2318fa57977689957781538acb2b1893c
2015-07-09 13:16:36 +01:00