I'm trying to put a check for assertions in my sqlx files. When I say, a check for assertions I want some "linting" measure that checks whether I have enough assertions in my sqlx files or not. I couldn't find any out-of-the-box/in-built tolls for this. Therefore, what I did was the following:
- I calculated the number of sql statement in a file – which are statements terminated by a semi colon minus the comments
- I calculated the number of times we have word “assertion”/assert
- I took the ratio
- I do this for all files.
- Wen I run my ci/cd I get some idea of the quality of checks in the sqlx
IS this a justified approach? IS there any inbuilt rule that does it better? Any suggestions?