Closed stronk7 closed 10 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
95a21b7
) 96.46% compared to head (644bdd2
) 96.59%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I've created these 2 issues (CiBoT and moodle-plugin-ci) to avoid this new sniff to be executed for plugins, it's only for core:
Ok, please don't merge this yet.
We need to change this Sniff commentRequiredRegex
property to become a configuration option.
That way other tools can use --runtime-set
(and others) in command line to get that aspect configured (without having to play with ruleset or phpcs.xml files).
Ciao :-)
Ok, I've added a new, 3rd commit, that adds the possibility of using a config setting to specify the desired regex to be used.
Add a new
moodleTodoCommentRegex
config optionWhile everything continues working the same and the Sniff property (
commentRequiredRegex
) still is available and defaulting toMDL-[0-9]+
, now we can, also, from command line, decide which regular expression to use.That will make things easier from other tools, not having to modify the ruleset phpcs.xml files. Instead just run:
vendor/bin/phpcs --runtime-set moodleTodoCommentRegex 'CONTRIB-[0-9]+'
or any other valid regular expression (https, github urls...)
In order to disable the Sniff, you can pass to it an empty string (apart from excluding it completely if desired, of course)
vendor/bin/phpcs --runtime-set moodleTodoCommentRegex ''
Thanks @paulholden and @kabalin !
This will look for some extra information to exist in:
By default it will look for all TODOs having some 'MDL-[0-9]+' (regular expression), but it can be customised, in ruleset , phpcs.xml file or in CLI execution by setting the
$commentRequiredRegex
property or themoodleTodoCommentRegex
configuration option to any alternative regular expression.Setting it to empty string will disable the sniff at all effects, useful for non-core stuff like plugins.
Fixes #90