-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About multiline lists and maps #56
Comments
Multi-lines lists are prohibited anyway. Although I am thinking of forcing a trailing comma on maps. |
I don't recall reading this, maybe it should be added? |
Multiline's are coming - sass/sass#216 |
Oh it's prohibited at Sass level. I misunderstood Hugo's comment. Well if it's comming, we can still anticipate this! |
I should make this clear. I don't think it is a good idea to use multiple lines for a list unless it has too many items to fit on a 80-characters long line. I'll add this. |
Added some extra content about lists. I'm still thinking about allowing/forcing trailing on maps. I can see the benefit. |
You got it. |
Current guidelines, about lists:
And maps:
I agree with these guidelines when the list/map fits in a signle line, but I like adding a trailing comma for multiline lists and maps. It allows to keep clean diffs when moving, appending or deleting lines, and don't require the developer (or a script) to handle differently the last line when editing code (this is annoying when using
sed
, multicursors, range substitution or macros for example).I know this is not something everybody likes, but at least the two style guides I follow for JavaScript and PHP are recommending this too, and I see Rust is looking forward to recommend this practice too.
So basically, I'm for the following (let's assume the example strings are long enough to require a multiline structure):
However, I would be okay with not having commas at all in a multiline list.
Opinions?
The text was updated successfully, but these errors were encountered: