-
-
Notifications
You must be signed in to change notification settings - Fork 965
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
Introduce formatter #956
Comments
imo, I want to use black as our formatter. |
+1 to use black. I also use black at https://github.com/CyberAgent/cmaes. |
Flake8 can also be a good formatter at times. |
Leaving some community statistics that shows how Black is being more adopted. Stars: https://star-history.t9t.io/#google/yapf&psf/black |
@/here btw, I will create PR with black. |
I think most of the core members are okay with black, so far. A PR could be a starting point to discuss it more in detail. Just curious how it will be different from #957 ? |
In my opinion, we need to avoid conflict with other pull requests as possible as we can. At least, #957 significantly increases the costs of other pull requests. |
I created two PRs for applying black to all files with following conditions, because it is better to compare them. Here, string format means converting
|
Thank you for the different PRs. The actual changes are much easier to see if the string normalizations are separated (as they are different commits). Briefly discussing this with the team, it seems like most are okay with introducing black, and in particular to align to However, as pointed out in #956 (comment), this might increase the cost of ongoing PRs. Do you have any suggestion on how to proceed? As most PRs are local enough, I for instance think that splitting up the PR won't benefit that much. We could try to merge larger PRs or long-running PRs prior to introducing the formatter. |
That is true. If we want to apply black, we need to think how to do it. Maybe, one of the best chances is just before next release? 🤔 |
I created a PR addressing above comment #1030 (c.f. #1020 (comment)). It has now been merged so let me close this issue. Thanks a lot @keisuke-umezawa for the long running investigation. |
Motivation
If we introduce a formatter to Optuna and just use it, we do not need to think about formatting.
Description
There are famous formatters in python:
c.f. https://blog.frank-mich.com/python-code-formatters-comparison-black-autopep8-and-yapf/
We need to discuss what formatter is best.
Differences of above formatters
black
"
instead of'
.black vs yapf
c.f. https://news.ycombinator.com/item?id=17155048
The text was updated successfully, but these errors were encountered: