Page MenuHomePhabricator

style: run a patched black on a subset of mercurial
Needs ReviewPublic

Authored by durin42 on May 4 2019, 11:19 PM.


Group Reviewers

This applied black to the 20 smallest files in mercurial/:

ls -S1 mercurial/*.py | tail -n20 | xargs black --skip-string-normalization

Note that a few files failed to format, presumably due to a bug in my
patch. The intent is to be able to compare results to D5064 with applied to black.

I skipped string normalization on this patch for clarity - in reality
I think we'd want one pass without string normalization, followed by
another to normalize strings (which is basically replacing ' with "

Diff Detail

rHG Mercurial
Lint Skipped
Unit Tests Skipped

Event Timeline

durin42 created this revision.May 4 2019, 11:19 PM

I would be happy to have our code auto-formatted. I assume this patch is just to show what the result will be and it's not meant to be queued until that patch for black has been accepted.


As I said on the pull request for black, I don't like that these lines get split up.

Yes, the intent is to show what the result of the patch to black is,
and once that lands to try and get consensus that we've addressed the
major issue with black and can move on. I've tried adding b prefixes
everywhere without black, or by using a different formatter, and the
other formatters just aren't good enough at wrapping lines, so not
using black will probably imply some kind of pain. :(

durin42 updated this revision to Diff 15039.May 8 2019, 3:31 PM
durin42 edited the summary of this revision. (Show Details)May 8 2019, 3:34 PM
durin42 updated this revision to Diff 15040.