You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Formatter must never fail and never add any warning
That's nice statement, but hardly an actionable issue. Can you please elaborate a bit more what the goal of this issue is? Otherwise I'm going to close it.
In this lib we do two things. We tokenize a query. And we format query. Both must be done in "we are sure" fashion and never assume anything.
What this issue namely aims is to get rid of https://github.com/doctrine/sql-formatter/blob/1.4.0/src/SqlFormatter.php#L221. This is namely the example which is currently wrong, the formatter must check if the indentation block has both start and end present, if not, no indentation must be done instead of ending it and warning about unexpected internal state.
As analysed in #116 (comment).
A little related with #39 formatting.
https://github.com/doctrine/sql-formatter/blob/1.4.0/src/Highlighter.php#L38-L46 should be removed then as we are very, very far validating queries (and it is impossible to do it in context-free parser).
Help welcomed.
The text was updated successfully, but these errors were encountered: