提问人:Victor Di 提问时间:11/15/2023 更新时间:11/15/2023 访问量:29
在 PyCharm 中重新格式化长列表,使每行有一个项目
Reformat long list in PyCharm to have one item per line
问:
当我在 Pycharm 中进行代码格式化时,它会以这种方式重新格式化长列表:
style1 = [
'Email:', 'SSN:', 'Address:', 'Home Phone:',
'Mobile Phone: ', 'DOB:', 'Date of Surgery:',
'Date of Service:', 'Facility of Service:', 'Clinic Number:',
'Employer:', 'Work Phone: ', 'Fax: ', 'Type:', 'IPA:',
'Health Plan:', 'ID #:', 'Claims Address:', 'Group #:',
'Claim # / PO #:', 'Phone:', 'Fax:', 'Contact',
'Adjuster Email', 'Util Review Phone', 'Util Review Fax',
'Doctor:', 'NPI #: ', 'Date of Injury: ', 'Body Parts:',
'Body Part Side:', 'Gender:', 'Diagnosis:', 'Diagnosis 2:',
'Procedure:'
]
有没有办法在 PyCharm 中重新格式化并每行有一个项目,如下所示:
style2 = [
'Email:',
'SSN:',
'Address:',
'Home Phone:',
'Mobile Phone: ',
'DOB:',
'Date of Surgery:',
'Date of Service:',
'Facility of Service:',
'Clinic Number:',
'Employer:',
'Work Phone: ',
'Fax: ',
'Type:',
'IPA:',
'Health Plan:',
'ID #:',
'Claims Address:',
'Group #:',
'Claim # / PO #:',
'Phone:',
'Fax:',
'Contact',
'Adjuster Email',
'Util Review Phone',
'Util Review Fax',
'Doctor:',
'NPI #: ',
'Date of Injury: ',
'Body Parts:',
'Body Part Side:',
'Gender:',
'Diagnosis:',
'Diagnosis 2:',
'Procedure:'
]
我试图用.editconfig来做到这一点,但还没有找到一个可以解决问题的参数。
答: 暂无答案
评论
', '
',\n'
ruff format