Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-19247

PHP CodeSniffer: tool for coding standard consistency

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Inactive
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Administration
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      To help improve the consistency and readability of Moodle code, I've added a standalone version of PEAR PHP_CodeSniffer in lib/pear. I've also added a small CLI script called phpcs

      The tool produces a report (per-file, summary or XML) of requested files, or of recursed directories.

      I've modified the PEAR code slightly so that it will default to the Moodle standard. Other standards have been removed.

      Another modification is to detect the presence of a "thirdpartylibs.xml" file in folders. This file is used to ignore any non-moodle code, because we won't be changing them so there is no need to report their errors. I've created one for lib/. This file could be used to help us manage the 3rd party library updates and track their licenses and versions.

      Coding guidelines used to create the CodeSniffer Moodle Standard: http://docs.moodle.org/en/Development:Coding_style#Files

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: