Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify that all the "todo" comments have an MDL issue associated #90

Closed
stronk7 opened this issue Jan 16, 2024 · 1 comment · Fixed by #91
Closed

Verify that all the "todo" comments have an MDL issue associated #90

stronk7 opened this issue Jan 16, 2024 · 1 comment · Fixed by #91

Comments

@stronk7
Copy link
Member

stronk7 commented Jan 16, 2024

Commented recently in a chat, it would be interesting to start emitting a warning when any "todo" comment:

  • // TODO: blah, blah, blah...
  • @todo blah, blah, blah...

is missing any MDL issue associated.

Surely we could apply for the same in @deprecated phpdoc tags too.

Note that all them are part of the coding style:

Ciao :-)

@marinaglancy
Copy link
Member

We were thinking of creating something like this for Workplace, but we will require the WP- prefix , not MDL-. I think a lot of plugin developers may need to customise this rule to have their own regex

stronk7 added a commit to stronk7/moodle-cs that referenced this issue Jan 17, 2024
This will look for some extra information to exist in:

- Inline TODO comments: // TODO blah, blah.
- PHPDoc @todo comments: /** @todo blah, blah. */

By default it will look for all TODOs having some 'MDL-[0-9]+'
(regular expression), but it can be customised, in phpcs.xml
file or in CLI execution by setting the "$commentRequiredRegex"
property to any alernative regular expression.

Setting it to empty string will disable the sniff at all effects,
useful for non-core stuff like plugins.

Fixes moodlehq#90
stronk7 added a commit to stronk7/moodle-cs that referenced this issue Jan 17, 2024
This will look for some extra information to exist in:

- Inline TODO comments: // TODO blah, blah.
- PHPDoc @todo comments: /** @todo blah, blah. */

By default it will look for all TODOs having some 'MDL-[0-9]+'
(regular expression), but it can be customised, in phpcs.xml
file or in CLI execution by setting the "commentRequiredRegex"
property 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 moodlehq#90
stronk7 added a commit to stronk7/moodle-cs that referenced this issue Jan 17, 2024
This will look for some extra information to exist in:

- Inline TODO comments: // TODO blah, blah.
- PHPDoc @todo comments: /** @todo blah, blah. */

By default it will look for all TODOs having some 'MDL-[0-9]+'
(regular expression), but it can be customised, in phpcs.xml
file or in CLI execution by setting the "commentRequiredRegex"
property 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 moodlehq#90
stronk7 added a commit to stronk7/moodle-cs that referenced this issue Jan 17, 2024
This will look for some extra information to exist in:

- Inline TODO comments: // TODO blah, blah.
- PHPDoc @todo comments: /** @todo blah, blah. */

By default it will look for all TODOs having some 'MDL-[0-9]+'
(regular expression), but it can be customised, in phpcs.xml
file or in CLI execution by setting the "commentRequiredRegex"
property 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 moodlehq#90
stronk7 added a commit to stronk7/moodle-cs that referenced this issue Jan 18, 2024
This will look for some extra information to exist in:

- Inline TODO comments: // TODO blah, blah.
- PHPDoc @todo comments: /** @todo blah, blah. */

By default it will look for all TODOs having some 'MDL-[0-9]+'
(regular expression), but it can be customised, in phpcs.xml
file or in CLI execution by setting the "commentRequiredRegex"
property 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 moodlehq#90
stronk7 added a commit to stronk7/moodle-cs that referenced this issue Jan 18, 2024
This will look for some extra information to exist in:

- Inline TODO comments: // TODO blah, blah.
- PHPDoc @todo comments: /** @todo blah, blah. */

By default it will look for all TODOs having some 'MDL-[0-9]+'
(regular expression), but it can be customised, in phpcs.xml
file or in CLI execution by setting the "commentRequiredRegex"
property 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 moodlehq#90
stronk7 added a commit to stronk7/moodle-cs that referenced this issue Jan 18, 2024
This will look for some extra information to exist in:

- Inline TODO comments: // TODO blah, blah.
- PHPDoc @todo comments: /** @todo blah, blah. */

By default it will look for all TODOs having some 'MDL-[0-9]+'
(regular expression), but it can be customised, in phpcs.xml
file or in CLI execution by setting the "commentRequiredRegex"
property 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 moodlehq#90
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants