@@ -2,9 +2,10 @@ COMPOSER := composer
22PHPUNIT := vendor/bin/phpunit
33FIXER := php build/php-cs-fixer.phar
44PSALM := php build/psalm.phar
5+ CMDS = $(wildcard src/Command/* .php)
56
67.PHONY :test
7- test : test-fixer psalm test-phpunit
8+ test : test-fixer psalm test-phpunit check-docs
89
910.PHONY :test-fixer
1011test-fixer : build/php-cs-fixer.phar
@@ -15,7 +16,7 @@ test-phpunit: vendor/autoload.php
1516 $(PHPUNIT )
1617
1718.PHONY :validate
18- validate : build/php-cs-fixer.phar vendor/autoload.php psalm
19+ validate : build/php-cs-fixer.phar vendor/autoload.php psalm check-docs
1920 $(FIXER ) fix --dry-run --stop-on-violation
2021 $(COMPOSER ) validate
2122 phpdbg -qrr $(PHPUNIT ) --coverage-text
@@ -28,6 +29,11 @@ psalm: build/psalm.phar
2829psalm-update-baseline : build/psalm.phar
2930 $(PSALM ) --update-baseline
3031
32+ .PHONY :check-docs
33+ check-docs : docs/CLI.md
34+ @echo " CHECKING if 'docs/CLI.md' needs to be committed due to changes. If this fails, simply commit the changes."
35+ git diff-files --quiet docs
36+
3137# Downloads everything we need for testing, used by Travis.
3238.PHONY : init
3339init : vendor/autoload.php build/php-cs-fixer.phar build/psalm.phar
@@ -65,3 +71,11 @@ vendor/autoload.php: composer.lock composer.json
6571 $(COMPOSER ) self-update
6672 $(COMPOSER ) install --no-suggest --no-progress
6773 touch $@
74+
75+ docs/CLI.md : $(CMDS )
76+ @rm -f $@
77+ @echo " <!-- AUTOMATICALLY GENERATED -->" >> $@
78+ @echo " <!-- REGENERATE VIA: make $@ -->" >> $@
79+ @echo " " >> $@
80+ @php bin/moodle-plugin-ci list --format md > $@
81+ @echo " REGENERATED $@ "
0 commit comments