This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Add new option PenaltyIndentedWhitespace
ClosedPublic

Authored by mnauw on Oct 31 2020, 8:09 AM.

Details

Summary

As the example in the comment within the patch shows, the intention of yet-another-penalty is to discourage some "far-right-cascading" indentation cases. Of course, mileage and taste may vary, so the default does not affect current behavior in any way. Likewise, the option may well be named otherwise (etc).

I realize the patch is likely incomplete (and requires additional test and documentation changes), but it would first have to be considered useful and acceptable in the first place.

Diff Detail

Event Timeline

mnauw created this revision.Oct 31 2020, 8:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 31 2020, 8:09 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
mnauw requested review of this revision.Oct 31 2020, 8:09 AM
MyDeveloperDay requested changes to this revision.Oct 31 2020, 9:46 AM
MyDeveloperDay added a subscriber: MyDeveloperDay.
  1. This requires unit tests
  2. This requires a fill context diff
  3. This requires changes to the ClangFormatStyleOptions.rst by running the dump_style tool in clang/docs/tools
This revision now requires changes to proceed.Oct 31 2020, 9:46 AM
mnauw updated this revision to Diff 302144.Nov 1 2020, 5:22 AM

Patch updated to include unit test and documentation changes (and to use full diff).

This revision is now accepted and ready to land.Nov 8 2020, 7:48 AM
mnauw added a comment.Nov 10 2020, 2:38 PM

Thanks. However, I do not have commit access, so someone may have to arrange for that ...

This revision was landed with ongoing or failed builds.Dec 1 2020, 3:01 PM
This revision was automatically updated to reflect the committed changes.