Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-2003

Run syntax check (lint) on all PHP files before the release

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Medium Medium
    • Integration
    • None

      This is a suggestion to establish a new rule: "Every file with .php extension must have correct PHP syntax (in other words, it must pass php -l). If there is a reason (eg for unit tests) to have a PHP file with broken syntax, it must have different extension."

      Such a rule would be enforced by a new pre-release step in the integration chain. Something like the following shell in Jenkins:

      #!/bin/bash -e
       
      find -L ${pathtomoodle} -name 'index.php' -print0 | xargs -0 -n 1 -P 4 php -l

      It ends with return status 0 (success) if no syntax error is detected. It stops with the return status >0 otherwise and Jenkins marks such a build as a failure.

            poltawski Dan Poltawski
            mudrd8mz David Mudrák (@mudrd8mz)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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