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

Verify the WhiteSpace ScopeIndent sniff, coz it has some problems

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.3
    • Fix Version/s: 3.0.3
    • Component/s: Local: Code checker
    • Labels:
      None
    • Affected Branches:
      MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              moodle.com, Eloy Lafuente (stronk7)
              Votes:
              2 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                14/Mar/16