Closed raiguard closed 2 years ago
I'd like to recommend this guide for git commit messages.
I like 120-160 characters as a line limit, if for no other reason than readability on Github with side-by-side diffs. Your screen may have room for 200 characters when writing the code; it probably doesn't have room for 400 characters when reviewing somebody else's PR.
I don't usually enforce a strict line length limit, but I just measured the editor layout i'm using and the main pane is close to 100 apparently, with a smaller (<80) pane next to it. If I full-screen a single pane i get out to about 190 or so.
I think a limit in 100-160 range is probably reasonable. I'd like most lines to be <100, but the occasional very long line doesn't really bother me.
You should not omit parenthesis for functions that take a unique table argument on a single line. You may do so for table arguments that span several lines.
I'm gonna disagree with this one too, since table arguments are so common in factorio's api and we're all used to it already.
I agree, I overlooked that one. I'll add it to the list.
flib uses stylua now, so there's no need for manually upkeeping style any longer.
I have been trying to follow this style guide recently, and it has served me pretty well. I like it because it has rationales for most of its points, and most of them are very reasonable.
But there are a few exceptions that I would like to make:
Hard line limit at 160 characters.As per discussion on Discord, there is no hard line limit, though try to keep everything under 120 characters. If something goes a bit over, it's not the end of the world.foo{bar=true, lorem="ipsum"}
src
directory.