#36177 closed Cleanup/optimization (fixed)
Add a newline to the end of file when generating JSON fixtures
Description ¶
Mostly I'd like to get rid of https://github.com/django/django/blob/0bac41fc7e4a842e8d20319cba31cc645501c245/.editorconfig#L24
It's a little annoying to work with in preparation for adding a CSS / JS formatter. While it won't run on JSON (yet?) it does complain about this line at the moment, and it feels a little awkward to have it in the first place.
It could also be useful if people like to concatenate fixtures to avoid getting the last }
of one fixture on the same line as {
of the next, and to avoid potential terminal issues around printing stuff without trailing newlines.
Another possibility is to actually format JSON files, which might be nice, and just add these newlines after the fact. If that seems like the better option, it's also fine.
Change History (9)
comment:1 by , 6 weeks ago
Cc: | added |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 3 weeks ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:3 by , 3 weeks ago
Has patch: | set |
---|
comment:4 by , 2 weeks ago
Patch needs improvement: | set |
---|
comment:5 by , 2 weeks ago
Patch needs improvement: | unset |
---|
comment:6 by , 2 weeks ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:8 by , 13 days ago
Same with this commit. Selected rebase and merge but it appears to have "squashed merged" and updated the commit message. Apologies
comment:9 by , 13 days ago
It is a bug in GitHub: https://github.com/orgs/community/discussions/153620
This appears to have been added in #22463, in the ticket description it appears to want new lines at the end of files. I can't find much specific discussion around JSON files
There seems to be a little discussion around not wanting a new line in #13182
Interestingly, when adding the .editorconfig to djangoproject.com this didn't have
insert_final_newline = ignore
I will tentatively accept