-
New Feature
-
Resolution: Fixed
-
Blocker
-
3.10.4, 3.11, 4.0
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_310_STABLE, MOODLE_311_STABLE
-
MDL-72013-master-int -
This is a followup of MDL-71113, where generating core's JS documentation with jsdoc was added. Original comment and code proposed there was:
I'm going to fail testing of this as I've just realised that we should have a Github Action check for any errors.
It's a really easy check:
npx jsdoc -c .grunt/jsdoc/jsdoc.conf.js --pedantic
Proposed diff:
index c85fd54b84e..2de0119a599 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -38,6 +38,9 @@ jobs:
git reset -- npm-shrinkwrap.json
git diff --cached --exit-code
+ - name: JSDoc Error failures
+ run: npx jsdoc -c .grunt/jsdoc/jsdoc.conf.js --pedantic
+
PHPUnit:
runs-on: ${{ matrix.os }}
services:
It was agreed to create this followup to allow the weekly cycle to continue and have some more time to see how and where this could be implemented.
In this issue we should be able to decide, and implement:
- What we want to be reported.
- What should lead to a failure in the check.
- Where we can add that new check (core's GHA/Travis, CiBoT, moodle-plugin-ci, grunt....)
This issue goes further than the original proposal and adds use of the eslint-jsdoc plugin with configuration to meet minimum documentation correctness.
With this patch the following changes will be observed:
- missing, incorrectly ordered, incorrectly defined, or additional parameters and properties for functions, methods, etc. will raise an error
- incorrect use of the @package tag will raise an error
- incorrect use of the @access tag will raise an error
- incorrect alignment of docblock asterisks will raise a warning
Any error will lead to a failure in eslint, which will prevent the building of the AMD module.