What
It would be nice if sqlfmt identifies CTEs that are not used in any from or join.
This would be implementing the rule L045 that Sqlfluff has.
Motivation
It is surprising how many times you find unused CTEs in code.
Especially when you develop following dbt practices, there are a lot of CTEs and sometimes by mistake you forget to change the reference, or you forget to delete it.
What It would be nice if sqlfmt identifies CTEs that are not used in any
from
orjoin
. This would be implementing the rule L045 that Sqlfluff has.Motivation It is surprising how many times you find unused CTEs in code.
Especially when you develop following dbt practices, there are a lot of CTEs and sometimes by mistake you forget to change the reference, or you forget to delete it.