-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Reformat with YAPF #11956
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
Reformat with YAPF #11956
Conversation
Oof, the handling of long strings inside exceptions is pretty ugly, would benefit from manual fixes. Is there any way to get it to automatically fix them? e.g. raise ValueError("this is a really long message"
" and continued here") |
Not sure, I just quickly tried it with the default settings. There are some configuration options: https://github.com/google/yapf#knobs |
where are we on this @jorisvandenbossche is this 'enough' to make a default formatter? |
I think we can use yapf for "fixing" code but I don't think we should use it on any automated basis. The output I see here would need quite a bit of manual fixing (cleaning up long strings in particular) |
right. I think we are ok with the |
I actually think it's good for people to fix their code manually (using flake8 on the command line) as a "learn good style the hard way" -- after a while (at least for me) you stop making style errors as you code. |
I have this in my .emacs which show up red when I have flake8 problems
|
ok with that as well. maybe we need to provide more config for flake8? (its already in not sure if you can control the backslash breaking (versus parens) |
We should put instructions in the developer docs. I looked through flake8 and I didn't see an option to check for usage of backslashes, so we may need to periodically review the codebase for cases that don't get caught during code review |
closing in favor of #11951 |
How long did it take to run yapf on pandas? I remember it being super slow. In fact: google/yapf#96 |
that is crazy long for that file, very weird! flaking it only takes a second (500 errors though :<) |
@hayd It was only a matter of seconds, but only tested on these 3 files. |
Just as an example (using the default configuration). The same files are adjusted as in #11951