imp: json: Decrease indentation in JSON output.
This commit is contained in:
		
							parent
							
								
									a291f5d33b
								
							
						
					
					
						commit
						58516eea77
					
				| @ -261,7 +261,7 @@ instance FromJSON (DecimalRaw Integer) | ||||
| 
 | ||||
| -- | Config for pretty printing JSON output. | ||||
| jsonConf :: Config | ||||
| jsonConf = Config{confIndent=Spaces 4,confCompare=compare, confNumFormat=Generic, confTrailingNewline=True} | ||||
| jsonConf = Config{confIndent=Spaces 2, confCompare=compare, confNumFormat=Generic, confTrailingNewline=True} | ||||
| 
 | ||||
| -- | Show a JSON-convertible haskell value as pretty-printed JSON text. | ||||
| toJsonText :: ToJSON a => a -> TL.Text | ||||
|  | ||||
| @ -5,111 +5,111 @@ | ||||
| # 1. Test the json output for register reports | ||||
| $ hledger -f- reg --output-format=json | ||||
| [ | ||||
|     [ | ||||
|         "2019-01-01", | ||||
|         null, | ||||
|         "", | ||||
|   [ | ||||
|     "2019-01-01", | ||||
|     null, | ||||
|     "", | ||||
|     { | ||||
|       "paccount": "a", | ||||
|       "pamount": [ | ||||
|         { | ||||
|             "paccount": "a", | ||||
|             "pamount": [ | ||||
|                 { | ||||
|                     "acommodity": "AAA", | ||||
|                     "aismultiplier": false, | ||||
|                     "aprice": null, | ||||
|                     "aquantity": { | ||||
|                         "decimalMantissa": 10, | ||||
|                         "decimalPlaces": 1, | ||||
|                         "floatingPoint": 1 | ||||
|                     }, | ||||
|                     "astyle": { | ||||
|                         "ascommodityside": "R", | ||||
|                         "ascommodityspaced": true, | ||||
|                         "asdecimalpoint": ".", | ||||
|                         "asdigitgroups": null, | ||||
|                         "asprecision": 1 | ||||
|                     } | ||||
|                 } | ||||
|             ], | ||||
|             "pbalanceassertion": null, | ||||
|             "pcomment": "", | ||||
|             "pdate": null, | ||||
|             "pdate2": null, | ||||
|             "poriginal": null, | ||||
|             "pstatus": "Unmarked", | ||||
|             "ptags": [], | ||||
|             "ptransaction_": "1", | ||||
|             "ptype": "VirtualPosting" | ||||
|           "acommodity": "AAA", | ||||
|           "aismultiplier": false, | ||||
|           "aprice": null, | ||||
|           "aquantity": { | ||||
|             "decimalMantissa": 10, | ||||
|             "decimalPlaces": 1, | ||||
|             "floatingPoint": 1 | ||||
|           }, | ||||
|           "astyle": { | ||||
|             "ascommodityside": "R", | ||||
|             "ascommodityspaced": true, | ||||
|             "asdecimalpoint": ".", | ||||
|             "asdigitgroups": null, | ||||
|             "asprecision": 1 | ||||
|           } | ||||
|         } | ||||
|       ], | ||||
|       "pbalanceassertion": null, | ||||
|       "pcomment": "", | ||||
|       "pdate": null, | ||||
|       "pdate2": null, | ||||
|       "poriginal": null, | ||||
|       "pstatus": "Unmarked", | ||||
|       "ptags": [], | ||||
|       "ptransaction_": "1", | ||||
|       "ptype": "VirtualPosting" | ||||
|     }, | ||||
|     [ | ||||
|       { | ||||
|         "acommodity": "AAA", | ||||
|         "aismultiplier": false, | ||||
|         "aprice": null, | ||||
|         "aquantity": { | ||||
|           "decimalMantissa": 10, | ||||
|           "decimalPlaces": 1, | ||||
|           "floatingPoint": 1 | ||||
|         }, | ||||
|         [ | ||||
|             { | ||||
|                 "acommodity": "AAA", | ||||
|                 "aismultiplier": false, | ||||
|                 "aprice": null, | ||||
|                 "aquantity": { | ||||
|                     "decimalMantissa": 10, | ||||
|                     "decimalPlaces": 1, | ||||
|                     "floatingPoint": 1 | ||||
|                 }, | ||||
|                 "astyle": { | ||||
|                     "ascommodityside": "R", | ||||
|                     "ascommodityspaced": true, | ||||
|                     "asdecimalpoint": ".", | ||||
|                     "asdigitgroups": null, | ||||
|                     "asprecision": 1 | ||||
|                 } | ||||
|             } | ||||
|         ] | ||||
|         "astyle": { | ||||
|           "ascommodityside": "R", | ||||
|           "ascommodityspaced": true, | ||||
|           "asdecimalpoint": ".", | ||||
|           "asdigitgroups": null, | ||||
|           "asprecision": 1 | ||||
|         } | ||||
|       } | ||||
|     ] | ||||
|   ] | ||||
| ] | ||||
| 
 | ||||
| # 2. Test the json output for balance reports | ||||
| $ hledger -f- bal --output-format=json | ||||
| [ | ||||
|   [ | ||||
|     [ | ||||
|         [ | ||||
|             "a", | ||||
|             "a", | ||||
|             0, | ||||
|             [ | ||||
|                 { | ||||
|                     "acommodity": "AAA", | ||||
|                     "aismultiplier": false, | ||||
|                     "aprice": null, | ||||
|                     "aquantity": { | ||||
|                         "decimalMantissa": 10, | ||||
|                         "decimalPlaces": 1, | ||||
|                         "floatingPoint": 1 | ||||
|                     }, | ||||
|                     "astyle": { | ||||
|                         "ascommodityside": "R", | ||||
|                         "ascommodityspaced": true, | ||||
|                         "asdecimalpoint": ".", | ||||
|                         "asdigitgroups": null, | ||||
|                         "asprecision": 1 | ||||
|                     } | ||||
|                 } | ||||
|             ] | ||||
|         ] | ||||
|     ], | ||||
|     [ | ||||
|       "a", | ||||
|       "a", | ||||
|       0, | ||||
|       [ | ||||
|         { | ||||
|             "acommodity": "AAA", | ||||
|             "aismultiplier": false, | ||||
|             "aprice": null, | ||||
|             "aquantity": { | ||||
|                 "decimalMantissa": 10, | ||||
|                 "decimalPlaces": 1, | ||||
|                 "floatingPoint": 1 | ||||
|             }, | ||||
|             "astyle": { | ||||
|                 "ascommodityside": "R", | ||||
|                 "ascommodityspaced": true, | ||||
|                 "asdecimalpoint": ".", | ||||
|                 "asdigitgroups": null, | ||||
|                 "asprecision": 1 | ||||
|             } | ||||
|           "acommodity": "AAA", | ||||
|           "aismultiplier": false, | ||||
|           "aprice": null, | ||||
|           "aquantity": { | ||||
|             "decimalMantissa": 10, | ||||
|             "decimalPlaces": 1, | ||||
|             "floatingPoint": 1 | ||||
|           }, | ||||
|           "astyle": { | ||||
|             "ascommodityside": "R", | ||||
|             "ascommodityspaced": true, | ||||
|             "asdecimalpoint": ".", | ||||
|             "asdigitgroups": null, | ||||
|             "asprecision": 1 | ||||
|           } | ||||
|         } | ||||
|       ] | ||||
|     ] | ||||
|   ], | ||||
|   [ | ||||
|     { | ||||
|       "acommodity": "AAA", | ||||
|       "aismultiplier": false, | ||||
|       "aprice": null, | ||||
|       "aquantity": { | ||||
|         "decimalMantissa": 10, | ||||
|         "decimalPlaces": 1, | ||||
|         "floatingPoint": 1 | ||||
|       }, | ||||
|       "astyle": { | ||||
|         "ascommodityside": "R", | ||||
|         "ascommodityspaced": true, | ||||
|         "asdecimalpoint": ".", | ||||
|         "asdigitgroups": null, | ||||
|         "asprecision": 1 | ||||
|       } | ||||
|     } | ||||
|   ] | ||||
| ] | ||||
| 
 | ||||
| >=0 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user