Hi, All patches in the codesniffer repo have a sample run against mwcore set up in CI. As can be seen in [0], the current version is triggered 13 times by MW core. No idea about extensions, though. Daimona
[0]: https://integration.wikimedia.org/ci/job/mw-tools-codesniffer-mwcore-testrun...
Il giorno lun 11 feb 2019 alle ore 17:49 Kosta Harlan kharlan@wikimedia.org ha scritto:
Hi Daimona,
Thanks for working on this. Have you run this against sniff against mw core or extensions? If so it would be useful to look at examples of what it’s catching in existing code.
Kosta
On Feb 9, 2019, at 9:26 PM, Stas Malyshev smalyshev@wikimedia.org
wrote:
Hi!
I was saying, you can find several examples of wrong and correct code at [1]. Thiemo pointed out that this patch could encourage to write shorter and less readable code (you can find his rationale in Gerrit comments), and
I
partly agree with him. My proposal is to only trigger the sniff if the
"if"
conditions are "short" enough. Which could mean either a single
condition,
shorter than xxx characters etc. We're looking for some feedback to know whether you would deem this
feature
useful, and how to tweak it in order to avoid encouraging bad code. Thanks to you all, and again - sorry for the half message.
This looks useful. I think PHPStorm has this check built in, but having it in sniffs too wouldn't be a bad thing. I've seen such things happen when refactoring code.
-- Stas Malyshev smalyshev@wikimedia.org
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l