Replies: 1 comment 1 reply
-
My preference has always been trailing but I think leading commas makes more sense now and we should be consistent everywhere. I do think it’s important we have |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently most (although not all) models use trailing commas, is it more common for basic models and has so far worked with no issue. As we add more optional field, such as those added by the conversions macro, we sometimes have to use leading commas as these fields are the last in a model but may or may not exist and not all warehouse support a hanging last comma.
This means we either need to make the comma itself on the model conditional on the variable and just trailing in the macro (ugly), mix existing trailing with leading in the macro (inconsistent), or move the whole model to leading (PR touching basically every line).
At some point, if/when we do introduce
sqlfluff
this is likely to be one of the core rules added first, so it makes sense to discuss and agree now.Most cases I have encountered gain additional flexibility from using leading, as much as I personally prefer to use trailing, but there may be cases for trailing I haven't considered.
4 votes ·
Beta Was this translation helpful? Give feedback.
All reactions