HomePhabricator

fix: allow fixer tools to return metadata in addition to the file content

Authored by hooper.

Description

fix: allow fixer tools to return metadata in addition to the file content

With this change, fixer tools can be configured to output a JSON object that
will be parsed and passed to hooks that can be used to print summaries of what
code was formatted or perform other post-fixing work.

The motivation for this change is to allow parallel executions of a
"meta-formatter" tool to report back statistics, which are then aggregated and
processed after all formatting has completed. Providing an extensible mechanism
inside fix.py is far simpler, and more portable, than trying to make a tool
like this communicate through some other channel.

Differential Revision: https://phab.mercurial-scm.org/D6167

Details

Committed
hooperMar 21 2019, 9:32 PM
Differential Revision
D6167: fix: allow fixer tools to return metadata in addition to the file content
Parents
rHG7c0ece3cd3ee: merge with stable
Branches
Unknown
Tags
Unknown