Page 1 of 1

[0.16.2]Game accepts extra comma in info.json

Posted: Thu Dec 14, 2017 10:12 pm
by aaargha
This is most likely a pretty minor issue but never the less:
Noticed by accident that the game accepts a incorrect comma on the last value. The mods.factorio.com correctly (I think?) rejects this so it's not really possible to distribute mods with this minor error.

Example (is also the attached mod):

Code: Select all

{
  "name": "Malformed",
  "version": "0.1.0",
  "factorio_version": "0.16",
  "title": "Malformed",
  "author": "aaargha",
  "contact": "",
  "homepage": "",
  "description": "",
}

Re: [0.16.2]Game accepts extra comma in info.json

Posted: Fri Dec 15, 2017 5:35 am
by dewiniaid
Also present in 0.15.37

I'd also appreciate it the game was strict in parsing info.json, since it can otherwise cause an hour or more of troubleshooting when trying to upload to the mod portal and wondering why it is rejected.

Re: [0.16.2]Game accepts extra comma in info.json

Posted: Fri Dec 15, 2017 8:39 am
by posila
Alright, fixed for 0.16.3

Re: [0.16.3]Game accepts extra comma in info.json

Posted: Fri Dec 15, 2017 5:31 pm
by dr_vm
Unfortunately, Factorio seems to fix this in a way that it quits resp. shutdowns directly instead of showing the Error to the user resp. modder.

0.000 2017-12-15 18:00:40; Factorio 0.16.3 (build 34357, linux64, steam)
......
1.862 Checksum of Vehicle_Radar: 3657150715
2.096 Loading sounds...
2.165 Error Util.cpp:49: Invalid comma before `]'. at __mini-machines__/migrations/mini-machines_4.0.9.json:7
2.249 Steam API shutdown.
2.251 Goodbye

Re: [0.16.2]Game accepts extra comma in info.json

Posted: Fri Dec 15, 2017 5:43 pm
by posila
Ah, we don't have native dialog for early errors on Linux.
Will take a look if it's possible to enter to minimal mode at this stage.

Re: [0.16.2]Game accepts extra comma in info.json

Posted: Fri Dec 15, 2017 10:11 pm
by riking
Let's not fix this and say we did

It's much easier to manually write JSON when you're allowed extra commas...

Re: [0.16.2]Game accepts extra comma in info.json

Posted: Fri Dec 15, 2017 10:37 pm
by posila
riking wrote:It's much easier to manually write JSON when you're allowed extra commas...
I think the mod portal argument is pretty strong.

Re: [0.16.2]Game accepts extra comma in info.json

Posted: Sun Dec 17, 2017 3:58 pm
by HanziQ
I thought we already had native_dialog with gtk for linux.

Anyway I am all for introducing json5, but do it with a .json5 extension and .json for valid json.