-
Bug
-
Resolution: Fixed
-
Minor
-
3.0.3
-
None
-
MOODLE_30_STABLE
-
MOODLE_30_STABLE
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:
- The sniff: ScopeIndentSniff.php
- The tests: moodle_whitespace_scopeindent.php
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.
- has a non-specific relationship to
-
CONTRIB-6195 Codechecker whitespace sniffs seem to be off
- Closed
- has been marked as being related by
-
CONTRIB-5681 Make prechecker to ignore the indentation rules for theme layout files
- Closed
- is a regression caused by
-
CONTRIB-5732 Upgrade local_codechecker CodeSniffer (phpcs) to recent version
- Closed