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

Problems looking for space around some operators

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.9
    • Fix Version/s: None
    • Component/s: Local: Code checker
    • Labels:
      None
    • Plugin Version:
      all
    • Affected Branches:
      MOODLE_29_STABLE

      Description

      Some versions ago we added a new sniff to look for proper spacing around operators:

      Squiz.WhiteSpace.OperatorSpacing

      https://github.com/stronk7/moodle-local_codechecker/commit/1b0301e5a8ce3887f31304c364dff7d0941dbc55

      with tests:

      https://github.com/stronk7/moodle-local_codechecker/commit/ea6b896a287df8faaeebf312b6650ec88535bceb

      In the plugin DB, Gareth J Barnard commented that such a sniff is missing some operators (bitwise and friends):

      Gents,
       
      Using 2.3.1 - San Fermín release! and getting errors for legitimate code in a js file:
       
      value·=·value·<<·2;
      Expected 1 space after "<"; 0 found
      Expected 1 space before "<"; 0 found
       
      .....
       
      value·|=·toggleflag;
      Expected 1 space after "|"; 0 found
      Expected 1 space before "="; 0 found
       
      .....
       
      value·&=·~toggleflag;
      Expected 1 space after "&" operator; 0 found
      Expected 1 space before "="; 0 found
      

      This is about to add those missing operators to the Sniff in order to get them properly evaluated.

      Ciao

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: