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

Problems looking for space around some operators

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • 2.9
    • Local: Code checker
    • None
    • all
    • MOODLE_29_STABLE

      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, gb2048 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

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

              Created:
              Updated:
              Resolved:

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