Note:

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

Plugin code prechecks: Difference between revisions

From MoodleDocs
m (Include the {{Plugins development}} template)
m (Add list and short description of the tests.)
Line 2: Line 2:


In the Moodle Plugins directory, uploaded plugins versions are automatically tested against a set of formal criteria. These tests typically do not check the actual plugin functionality, security or code correctness. They are more focused on formal aspects of the coding style. As such, they are most valuable for the plugin maintainers themselves.
In the Moodle Plugins directory, uploaded plugins versions are automatically tested against a set of formal criteria. These tests typically do not check the actual plugin functionality, security or code correctness. They are more focused on formal aspects of the coding style. As such, they are most valuable for the plugin maintainers themselves.
== Labels ==


Plugin version with no detected errors or warnings has a label like this displayed:
Plugin version with no detected errors or warnings has a label like this displayed:
Line 18: Line 20:


Finally, clicking some of these individual test labels takes you to a page with detailed raw output of the test system.
Finally, clicking some of these individual test labels takes you to a page with detailed raw output of the test system.
== Test types ==
; phplint : Checks the plugin source code for correct PHP syntax.
; phpcs : Checks the plugin against the [[Coding style|Moodle coding style]].
; js : Checks the plugin against the [[Javascript/Coding_Style|Javascript coding style]].
; css : Checks the plugin against the [[CSS Coding Style|CSS coding style]].
; phpdoc : Checks that the plugin files, classes and functions are documented in the source code.
; savepoint : Reports issues detected with the handling of [[Upgrade API|upgrade savepoints]].
; thirdparty : Reports issues with the [[Plugin files#thirdpartylibs.xml|thirdpartylibs.xml]] file.
; grunt : Reports issues with [[Grunt]] builds.
; shifter : Reports issues with [[YUI/Shifter]].
; mustache : Reports issues with [[Templates|Mustache templates]].

Revision as of 10:03, 20 March 2017


In the Moodle Plugins directory, uploaded plugins versions are automatically tested against a set of formal criteria. These tests typically do not check the actual plugin functionality, security or code correctness. They are more focused on formal aspects of the coding style. As such, they are most valuable for the plugin maintainers themselves.

Labels

Plugin version with no detected errors or warnings has a label like this displayed:

plugin-codeprechecks-success.png

If there are some formal errors or warnings detected, a label like this is displayed:

plugin-codeprechecks-error.png

The first of the two numbers gives the total number of detected errors, the second number shows the number of warnings. If there are no errors but some warnings, the label is displayed in orange colour. In case of some errors, the label is displayed in red.

Clicking the code prechecks label takes you to a page with details on particular tests executed. Individual labels are displayed for each of the test, with the same formatting rules as described above.

plugin-codeprechecks-details.png

Finally, clicking some of these individual test labels takes you to a page with detailed raw output of the test system.

Test types

phplint
Checks the plugin source code for correct PHP syntax.
phpcs
Checks the plugin against the Moodle coding style.
js
Checks the plugin against the Javascript coding style.
css
Checks the plugin against the CSS coding style.
phpdoc
Checks that the plugin files, classes and functions are documented in the source code.
savepoint
Reports issues detected with the handling of upgrade savepoints.
thirdparty
Reports issues with the thirdpartylibs.xml file.
grunt
Reports issues with Grunt builds.
shifter
Reports issues with YUI/Shifter.
mustache
Reports issues with Mustache templates.