Moodle PHPdoc check

General plugins (Local) ::: local_moodlecheck
Maintained by Marina Glancy, One poor developer...Eloy Lafuente (stronk7), Coolie and AndrewAndrew Lyons
Part of set Moodle development.
Tool for Moodle developers: allows to check phpdocs in the code for compliance with Moodle Coding Style.
Latest release:
292 sites
428 downloads
20 fans
Current versions available: 2

The latest version of this plugin is available on github

Install the source into the local/moodlecheck directory in your moodle

Log in as admin and select:

Settings -> Site administration -> Development -> Moodle PHPdoc check

enter paths to check and select rules to use.

Customization:

You can add new rules by adding new php files in rules/ directory, they will be included automatically. Look at other files in this directory for examples.

Please note that if you register the rule with code 'mynewrule', the rule registry will look in language file for strings 'rule_mynewrule' and 'error_mynewrule'. If they are not present, the rule code will be used instead of the rule name and
default error message appears.

Screenshots

Screenshot #0
Screenshot #1

Contributors

Marina Glancy (Lead maintainer)
One poor developer...
Eloy Lafuente (stronk7)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Jan Eberhardt
    Alhamisi, 13 Nov 2014, 5:34 PM
    Please share this plugin in a GIT repo... would be very convinient.
  • Marina Glancy
    Ijumaa, 14 Nov 2014, 5:31 PM
    https://github.com/moodlehq/moodle-local_moodlecheck - and it's actually much more recent code there
  • Sandipa Mukherjee
    Jumatano, 3 Okt 2018, 8:29 PM
    I need to test a plugin for moodle 3.5. But this doc checker plugin did not work.
  • Dan Baker
    Jumatano, 18 Sep 2019, 7:30 AM
    For moodle 3.5 you need to add in version.php :

    $plugin->component = "local_moodlecheck";
  • James Calder
    Ijumaa, 28 Jul 2023, 12:52 PM
    Hi,
    I just tried running the latest version from GitHub, and where I use fully qualified class names in parameter lists, it complains:
    Phpdocs for function xxx has incomplete parameters list (error)
    Is this intentional? Is it recommended to add "use" to PHP files instead of having fully qualified class names?
    Thanks.
  • One poor developer...
    Ijumaa, 28 Jul 2023, 3:55 PM
    Hi James,

    I'd recommend you to create and issue @ https://github.com/moodlehq/moodle-local_moodlecheck/issues with as many details as possible (code example or link to it, results that you are getting...).

    That would help a lot to better reproduce, understand and fix the problem.

    Ciao smile
  • James Calder
    Jumanne, 15 Ago 2023, 6:40 PM
    Hi,
    I notice the checker currently doesn't validate PHPDoc types. I think this would be good to do, especially since it does some type checking (best to ensure that the types being checked are valid). I've put something together here:
    https://github.com/james-cnz/moodle-local_moodlecheck/tree/parse_extended_array_types
    It's pretty basic, but I think it accepts probably the most commonly used types, and I think accepting many more types would make it difficult to do the type checking. It expects types to have no whitespace in them, because that's what the checker currently seems to assume. Is this of interest? Should I make it into a pull request?
    Cheers,
    James
Please login to post comments