[SERVER-37602] Upgrade yapf to 0.24.0 Created: 12/Oct/18  Updated: 29/Oct/23  Resolved: 08/Apr/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.1.10

Type: Improvement Priority: Major - P3
Reporter: Benjamin Caimano (Inactive) Assignee: Mathew Robinson (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-37588 Python linters version incompatability Closed
Backwards Compatibility: Fully Compatible
Sprint: Dev Tools 2019-03-11, Dev Tools 2019-03-25, Dev Tools 2019-04-08, Dev Tools 2019-04-22
Participants:

 Description   

I think that there are definite readability benefits to yapf==0.24.0. e.g.

left 0.24.0, right 0.21.0

2025,2028c2003,2005
<     program_options.add_option(
<         "--logLevel", dest="log_level", choices=log_levels,
<         help="The log level. Accepted values are: {}."
<         " [default: '%default'].".format(log_levels), default="info")
---
>     program_options.add_option("--logLevel", dest="log_level", choices=log_levels,
>                                help="The log level. Accepted values are: {}."
>                                " [default: '%default'].".format(log_levels), default="info")
2260,2262c2237,2239
<     ssh_connection_options = "{} {}".format(
<         default_ssh_connection_options,
<         options.ssh_connection_options if options.ssh_connection_options else "")
---
>     ssh_connection_options = "{} {}".format(default_ssh_connection_options,
>                                             options.ssh_connection_options
>                                             if options.ssh_connection_options else "")

That said, the changes to the python code are quite a few lines of trivial differences. It also probably means converting percent sign format lines to format function calls. Hence this is a separate ticket.



 Comments   
Comment by Mark Benvenuto [ 29/Oct/18 ]

I don't want to update yapf this year again since it was already updated in Spring 2018. It causes a lot of problems because it requires users to reinstall their pip modules since most people don't run scons lint in virtualenv. We could consider doing after switching to Python 3.

Generated at Thu Feb 08 04:46:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.