This is an archive of the discontinued Mercurial Phabricator instance.

contrib: add a fork of black (as "grey") that includes my changes
ClosedPublic

Authored by durin42 on Oct 6 2019, 1:32 PM.

Details

Summary

This is black with https://github.com/psf/black/pull/826 applied as of
today. The current git hash of black master is
d9e71a75ccfefa3d9156a64c03313a0d4ad981e5, and the hash of my commit is
dc1add6e94e212eff37bb3619e1422fb3c6d8dc8. In order to use this, you
need to install black (from github master) and typed-ast using
pip, preferably into python3, and then you can run grey.py with that
Python and you'll have my patched version of black, which is how we've
been formatting the codebase.

Once my PR is merged, I'll follow up by removing this fork and
updating instructions in the example config.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

durin42 created this revision.Oct 6 2019, 1:32 PM
indygreg accepted this revision.Oct 6 2019, 1:35 PM
This revision is now accepted and ready to land.Oct 6 2019, 1:35 PM
indygreg requested changes to this revision.Oct 6 2019, 2:35 PM
$ pip3.7 install --upgrade black
<snip>
$ python3.7 contrib/grey.py
Traceback (most recent call last):
  File "contrib/grey.py", line 54, in <module>
    from _version import version as __version__
ModuleNotFoundError: No module named '_version'

What am I doing wrong?

Also, should we add a shebang and make the file executable?

This revision now requires changes to proceed.Oct 6 2019, 2:35 PM
durin42 edited the summary of this revision. (Show Details)Oct 6 2019, 2:55 PM
durin42 updated this revision to Diff 16915.
indygreg accepted this revision.Oct 6 2019, 4:14 PM

Works with the custom installed black version.

This revision is now accepted and ready to land.Oct 6 2019, 4:14 PM