Can I have a coverage exclusion based on the file content?

The coverage exclusion settings for a project are excluding files based on filename or path / location (directory). We have code files that are auto-generated by tooling that I do not want to include in the coverage, and they are mixed in folders amongst code I do want included (so using filenames and paths doesn’t help)… and can only be distinguished from other code files by predictable strings in the content of the file… eg “Code generated by blah-tool. DO NOT EDIT”

How can I set a coverage exclusion for files, where the content matches a pattern ?

[ I see a configuration option that is similar to the matching I want to do for ignoring issues, but I’m trying to do a similar thing to exclude from coverage ]

(using Community Edition Version 8.7 (build 41497)

Check this out. Might help at d772b9e16093e2cc1447b630c10b987ff51a99e2 · SonarSource/ · GitHub