-
Notifications
You must be signed in to change notification settings - Fork 27
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
Decide on and then enforce line length #214
Comments
I really don't mind. Black's 88 is also a sort of standard in Python land now. I would like to point out that a lot of this linting stuff started from here: #191 (comment). Note that I was referring to the line length of prose text in a docstring. I think that is a bit of a different case from actual code because the docstring text is shown directly to users e.g.:
I wrote part of that docstring myself and wrapped all prose parts to 78 characters. One doctest line exceeds 78 characters a little but I decided it was better just to exceed the wrapped line length in that particular case (which I could because there was no linter enforcing any line length limit). Line length in the code is not user-facing so is different. I do still find it harder to read 120-length lines of code (regardless of how big the monitor is) but I have not complained about many long lines when reviewing many pull requests. It does seem that line length is a bit tricky in Cython code when calling C functions as well because there are many functions that take many arguments and all function names are always fully qualified and arguments often need casting etc. This often leads to function calls that don't fit in 80 characters but I'm not sure that trying to adhere to some line length would make that code more readable. |
Enforcing 88 length lines comes up with about 500 linting errors, which is annoying but not impossible to hand edit. length 100 is about 250 changes. If we just pick 120 then it's only 35 changes which is essentially "free" to refactor. I don't think there's a way to use any formatting tools to do this for us. I don't have massive opinions on what we should do, but generally keeping the line lengths shorter makes life easier than harder. I guess a lot of the long c function calls would end up as: def some_function(self, other):
....
some_c_binding(
some, variables, here
)
return something which i think I generally did myself when writing code but probably not everywhere. |
Not urgent, but making an issue to track this. At some point we probably want to enforce rule E501 for the liner and pick a line length. 120 is pretty long, 80 is standard.
The text was updated successfully, but these errors were encountered: