I tried `git cl format --python` on https://chromium-review.googlesource.com/c/chromium/src/+/1303887/10/build/toolchain/win/ml.py
It mostly looks reasonable, but it seems to do objectively worse with slice syntax:
- del objdata[coff_header.PointerToSymbolTable + debug_sym * SYM.size():
- coff_header.PointerToSymbolTable + (debug_sym + 2) * SYM.size()]
+ del objdata[coff_header.PointerToSymbolTable +
+ debug_sym * SYM.size():coff_header.PointerToSymbolTable +
+ (debug_sym + 2) * SYM.size()]
- del objdata[
- COFFHEADER.size() + debug_section_index * SECTIONHEADER.size():
- COFFHEADER.size() + (debug_section_index + 1) * SECTIONHEADER.size()]
+ del objdata[COFFHEADER.size() +
+ debug_section_index * SECTIONHEADER.size():COFFHEADER.size() +
+ (debug_section_index + 1) * SECTIONHEADER.size()]
(Unrelatedly, this is also harder to read:
- SECTIONHEADER = Struct('SECTIONHEADER',
- '8s', 'Name',
- 'I', 'VirtualSize',
- 'I', 'VirtualAddress',
-
- 'I', 'SizeOfRawData',
- 'I', 'PointerToRawData',
- 'I', 'PointerToRelocations',
- 'I', 'PointerToLineNumbers',
-
- 'H', 'NumberOfRelocations',
- 'H', 'NumberOfLineNumbers',
- 'I', 'Characteristics')
+ SECTIONHEADER = Struct('SECTIONHEADER', '8s', 'Name', 'I', 'VirtualSize', 'I',
+ 'VirtualAddress', 'I', 'SizeOfRawData', 'I',
+ 'PointerToRawData', 'I', 'PointerToRelocations', 'I',
+ 'PointerToLineNumbers', 'H', 'NumberOfRelocations',
+ 'H', 'NumberOfLineNumbers', 'I', 'Characteristics')
But I don't have a great suggestion for what to do about that.)
(I didn't see a reply to my "how do I report issues" question, so filing a crbug with a pyformat label for now.)
Comment 1 by abenner@google.com
, Oct 29