Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-6146

Verify the WhiteSpace ScopeIndent sniff, coz it has some problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.0.3
    • 3.0.3
    • Local: Code checker
    • 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:

      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.

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.