Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 4.10.0-beta1
-
None
-
3b596eef4029a58eff8189851e6200437ee42700 (qt-creator/qt-creator/master)
Description
using this very simple script:
import json import sys for f in sys.argv[1:]: print(f"Loading \{f}") with open(f) as fp: try: json.load(fp) except Exception as e: print(str(e))
and this command:
find share/qtcreator/templates/wizards/ -name '*.json' | xargs python3 ../load-json.py
I get 2 invalid json files:
Loading share/qtcreator/templates/wizards/projects/vcs/git/wizard.json Invalid \escape: line 16 column 59 (char 574) Loading share/qtcreator/templates/wizards/files/java/wizard.json Invalid \escape: line 12 column 137 (char 466)
the curlprint is
"options": [ { "key": "ClassName", "value": "%{JS: value('FileName').charAt(0).toUpperCase() + value('FileName').substr(1).replace(/\.java$/,'')}" } ],
and
{ "key": "SR", "value": "%{JS: '%{Repo}'.replace(/\.git$/, '') }"},
The question is that is it as easy to fix as escaping the backslash? How to validate that the change won't break anything?
Is it possible to add this sort of checks somewhere in the test subsystem?