Skip to content

Conversation

@IanButterworth
Copy link
Member

Saving JSON files with long arrays results in very long documents currently because of all the newlines.
This only prints newlines after array elements if the length of the array is > 5.

i.e.

{
  "x": [1,2,3,4,5,6,7,8,9,10]
}

instead of

{
  "x": [
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10
 ]
}

Fixes #291

@IanButterworth
Copy link
Member Author

The travis error is just a Pkg download glitch

@codecov
Copy link

codecov bot commented Apr 15, 2020

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.74%. Comparing base (55f8500) to head (191b727).
Report is 32 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #305      +/-   ##
==========================================
+ Coverage   92.60%   92.74%   +0.13%     
==========================================
  Files           6        6              
  Lines         311      317       +6     
==========================================
+ Hits          288      294       +6     
  Misses         23       23              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@IanButterworth
Copy link
Member Author

IanButterworth commented Apr 16, 2020

This shouldn't be merged as-is. Needs rethinking.
Also JSON3.jl doesn't print newlines for arrays, so I'm giving that a go for now

@IanButterworth IanButterworth marked this pull request as draft April 16, 2020 15:16
@gasagna
Copy link

gasagna commented May 12, 2022

Any chance this can be revived?

@quinnj
Copy link
Member

quinnj commented Apr 30, 2025

Closing as stale and could use a more modern approach to how to configure

@quinnj quinnj closed this Apr 30, 2025
@IanButterworth IanButterworth deleted the denser_arrays branch April 30, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dense printing for long arrays

3 participants