This is an archive of the discontinued LLVM Phabricator instance.

[libc++][NFC] Reformat features.py
ClosedPublic

Authored by ldionne on Jun 12 2023, 11:34 AM.

Details

Reviewers
Mordante
Group Reviewers
Restricted Project
Commits
rG52310ce9c167: [libc++][NFC] Reformat features.py
Summary

This file was reformatted using the Black tool, which led to entirely
unreadable code due to how lines are broken. Formatting tools are fine,
but not when they lead to code that humans have trouble reading. In the
case of features.py, a lot of it was meant to be aligned in a repetitive
but consistent way to make the structure of the code stand out.
Reformatting with the tool lost that property.

Diff Detail

Event Timeline

ldionne created this revision.Jun 12 2023, 11:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2023, 11:34 AM
Herald added a subscriber: arichardson. · View Herald Transcript
ldionne requested review of this revision.Jun 12 2023, 11:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2023, 11:34 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante accepted this revision.Jun 12 2023, 11:57 AM
Mordante added a subscriber: Mordante.

No objection, but can you provide feedback regarding this issue on Discourse. I expect somebody will suggest enforcing Python formatting on commits; actually quite surprised that wasn't done in this project.

I consider most changes by black not a real improvement.

libcxx/utils/libcxx/test/features.py
26
236

FYI I don't feel these changes by black are bad.

This revision is now accepted and ready to land.Jun 12 2023, 11:57 AM
ldionne marked an inline comment as done.Jun 13 2023, 10:24 AM

No objection, but can you provide feedback regarding this issue on Discourse. I expect somebody will suggest enforcing Python formatting on commits; actually quite surprised that wasn't done in this project.

I consider most changes by black not a real improvement.

Will do. Almost all of the changes I've seen so far have made code much less readable than it used to be. I missed the original discussion but if I had seen it and the result of the reformatting patch, I would have been an over-my-dead-body objection.

I'm in favour of automated formatting in the general case -- we didn't have clang-format and we do now. But when automated formatting makes the code really hard to read for arbitrary restrictions like 89 column width, then I'm not on board anymore.

This revision was automatically updated to reflect the committed changes.