Link in forums: https://moodle.org/mod/forum/discuss.php?d=328076
With the latest upgrade of codechecker (
CONTRIB-5732) to use a recent phpcs version, it was found that the (generic) Indentation Sniff had become specially picky when mixing php & html. We alleviated the situation by re-creating our own Indentation Sniff, verifying that existing tests were passing:
But it seems that a number of cases, previously not being reported are now incorrectly thrown. Basically every php embed with a non-zero indentation leads to false errors. Example:
Lines #55, #80 and #82 of https://github.com/roelmann/moodle-theme_flexibase/blob/master/layout/secure.php
I've attached a complete run of the flexibase, with false errors in red, as reference.
So this is about to try to fix those php & html mixes reported as incorrect indentation, when they should be allowed.
Note this applies to 2 cases:
1) Line #55 above, php code has an indentation > than the php open tag. Maybe this should be considered wrong indentation, after all. In the other side we don't compute excess of indentation (exact mode), only missing indentation, so maybe it's ok after all... and then...
2) Line #80 and #82 above, php code has the same indentation that the php open tag. This should be allowed. Same rules than to global php open tag apply.
And that's it. Nice to have Flexibase as a goof repertory of what we can find out there.