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