-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
black codestyle #3239
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
black codestyle #3239
Conversation
I have concerns about that as some PRs are in progress and will be affected by changes. |
I agree that this looks much better. Seemed like you used an older commit, however. I think this could be a good time for this, I don't think there are many active WIP commits, mainly #3214 |
Yes, things changed in a week and I did not |
28c9d85
to
14d5421
Compare
I got issues with rebase and just recreated the branch, I suppose same issues will be with ongoing PRs |
We can wait until #3214 and then do the refactoring not to make a mess. Another option is trying to rebase it on top of this branch to check if it can be done with little pain |
Copy paste from slack Black is used in ArviZ Its mostly good, but when its bad, I think its pretty bad |
How does one use this? |
It does look better on the whole. I don't think we need to enforce this every time someone commits code, but perhaps run it prior to releases? |
It is pretty quick as a first check on CI: we run
which takes 0.1s on my machine. Running on PyMC3, it takes 7s, but it is finding actual errors. To change the code, you leave out the I find the biggest benefit for a project is fewer nitpicking formatting requests - within seconds of making a PR, you're reminded to run black on your own code and resubmit. The biggest benefit for me is that most editors (vim or VS code) will run it automatically on save, and I'm not even thinking about line length or making shorter variable names. Note that it does not replace pylint or pydocstyle, but it conforms to both. |
As I remember pycodestyle is less restrictive and thus less consistent Oh, misread, pydocstyle? |
You can also just run |
pydocstyle checks to make sure docs are in correct format which black doesn't do. All three work well together! |
I don't think I really like this idea. This touches most of the code in pymc3, so a simple |
As always, @aseyboldt makes a pretty compelling case and from the likes on his comment it seems like there is critical mass in agreement, so I'm closing this. |
Yes, that was a very fair point |
With this tool code looks much prettier. This is the first preview commit, we should integrate this with CI if it is all good