Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Automated code review

From MoodleDocs
Revision as of 11:54, 17 July 2014 by Dan Poltawski (talk | contribs) (Initial page to explain automated checks and how developers should react to them)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.


Moodle issues submitted for review and inclusion into core are examined by our continuous integration (ci) system and checked against various automated tests. We use the automated checks to help improve the code quality in Moodle.

What is CiBot?

CiBot is our automated code checker and it will run checks against any issues waiting for peer review, sent for integration or requested to be checked by the developer. It will report problems discovered in lines of your patch which you are changing.

What checks is CiBot carrying out on each issue?

  • Automated coding style checks using local_codechecker
  • Automated phpdocs checks using local_moodlecheck

Will an issue be automatically rejected if cibot checks fail?

No. You should strive to have cibot approve your change if its possible. On some occasions cibot will detect issues present in existing code which we do not expect you to correct (see the next item).

Should coding style issues in existing code be fixed?

In general, please only update lines relating to your own change. Policy for this situation is being discussed in MDL-43233.

Example situations

Spacing of if statments is incorrect on the line being changed

This can be corrected without affecting existing code, so should be fixed.

The line being changed contains an invalid variable name

If correcting this variable would affect other parts of the code not covered by the patch then its not reasonable to fix it.