Hi,
I think before even thinking of such a specific solution (which is quite convoluted to be fair), it would be nice to expose the use-case you're trying to address, and specific challenges it intends to solve.
Note that having the ability to benefit from powerful analyzers, as you code, without requiring a full SonarQube installation, is precisely the reason why SonarLint is born:
https://www.sonarlint.org
Give SonarLint a try if not done yet. Then with both SonarLint and SonarQube in mind, feel free to share any unsolved challenge you're currently having.
Best regards,
Nicolas