JSON output format for Pants options

Review Request #4113 - Created July 23, 2016 and submitted

Information
Ebube Chuba
pants
3161
Reviewers
pants-reviews
nhoward_tw, peiyu, stuhood, wisechengyi, zundel

Allows Pants options to be printed in formatted JSON. Each value stores a dict containing source, value, and optionally history keys.

Call: ./pants options --output-format=json
Output:

{
  ...
  "bench.jvm_options": {
    "source": "CONFIG", 
    "value": "['-Xmx1g', '-XX:MaxPermSize=256m']"
  }, 
  "bench.memory": {
    "source": "HARDCODED", 
    "value": "False"
  },
  ...
}

Call: ./pants options --output-format=json --show-history
Output:

{
  ...
  "bench.jvm_options": {
    "history": [
      "overrode (u\"REPLACE +[u'-Xmx1g', u'-XX:MaxPermSize=256m'] -[]\", u'CONFIG')", 
      "overrode (u\"REPLACE +[u'-Xmx256m'] -[]\", u'HARDCODED')"
    ], 
    "source": "CONFIG", 
    "value": "['-Xmx1g', '-XX:MaxPermSize=256m']"
  }, 
  "bench.memory": {
    "history": [], 
    "source": "HARDCODED", 
    "value": "False"
  }, 
  ...
}

Travis: https://travis-ci.org/ebubae/pants/builds/147534348

Issues

  • 0
  • 4
  • 0
  • 4
Description From Last Updated
Peiyu Wang
Yujie Chen
Nick Howard (Twitter)
Ebube Chuba
Eric Ayers
Ebube Chuba
Ebube Chuba
Eric Ayers
Nick Howard (Twitter)
Yujie Chen
Ebube Chuba
Ebube Chuba
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as c7f6093381d6f838ed6e600c35f69f8bee013c62

Loading...