Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print longer arrays without newlines #305

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

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

Merging #305 into master will increase coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
src/Writer.jl 85.86% <100.00%> (+0.98%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55f8500...191b727. Read the comment docs.

@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?

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
2 participants