-
Notifications
You must be signed in to change notification settings - Fork 42
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
XML and JSON file check broadness #275
Comments
We still need a real xml file to do the schema validation https://github.com/xbmc/addon-check/tree/master/kodi_addon_checker/xml_schema |
I don't understand. Why check a file for its XML schema, when the file extension isn't xml? |
We obviously won't do that. But whatever get's commited to an addon repo, needs to be a xml - kodi or the repo servers doesn't understand jinja2 or other markups. |
Well, in this specific case I'm using a jinja2-like templating language to dynamically build the XMLs I need, on plugin start. Because of the restrictions to the templating language in addons (no includes, no default variables) this is the only way to write reusable markup. Are all files containing ".xml" in their filename validated, or just the ones explicitly in xml-containing folders, such as "resource/skins/"? |
Nevertheless: I think the addon checker should check for the actual extension, not whether ".xml" or ".json" is inside the filename. |
Only the addon.xml of your addon
|
What you mean, is this check
|
Yes. I mean those. |
PR #276 should be correct for this. |
Thanks! |
Hey,
The current implementation of the XML and JSON validators look for filenames containing ".xml" or ".json", instead of checking whether the extension actually is the right one (
endswith
, oros.path.splitext()[1]
).This leads to issues with for example templating languages: I can't name my template "test.xml.tpl", or "test.xml.jinja2".
As those file would never even be "executed"/parsed as XML or JSON, I think the filename check is too broad.
The text was updated successfully, but these errors were encountered: