Question

I'm trying to do something that might seem strange but that makes sense. I would like to manually trigger a violation in Checkstyle from within in my code.

Let's say I'm working on a project where all code is written in french. (Yes, I'm french). While during code review, if there are some english labels/class names/file names/whatever left in the project, I would like to annotate then in order to trigger CheckStyle errors/warnings.

Why do that instead of correct it immediatly? Well, because renaming something from english to french might need some heavy refactoring and thus cannot be done simply. But I do want to keep track of it in my CheckStyle reports.

So is there some kind of magic annotation I can use?

PS : I would like to use it both in Java (CheckStyle) and PHP (PHP_CodeSniffer). Thanks,

Was it helpful?

Solution

I would just insert a TODO-comment. Checkstyle has a check for that called TodoComment

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top