2022-12-03

IntelliJ IDEA can now exclude methods from code coverage

Screenshot from "What's New in IntelliJ IDEA 2022.3"

The latest version of IntelliJ IDEA supports a new option for excluding certain methods from code coverage by annotation, and it is the result of a feature request posted by me!

Note that the wording in the screenshot is a bit goofy, presumably because they have non-programmers in charge of the "What's New in IntelliJ IDEA" page, or perhaps non-java-programmers. The new option does not allow us to control which annotations will be excluded, it allows us to control which annotations will cause code to be excluded. Actually, the news is not even the fact that there is now an option that allows us to control those annotations; the news is that the IntelliJ IDEA code-coverage analyzer can now exclude code by annotation, and by the way, it even allows us to specify which annotations will achieve  this.

In my original feature request I had asked for something a bit more complex and more useful that what they ended up delivering, but this is still a good step in the right direction. The feature request was IDEA-292401 "Exclude specific methods from coverage" and can be found at:

https://youtrack.jetbrains.com/issue/IDEA-292401/Exclude-specific-methods-from-coverage


No comments:

Post a Comment