Two at the same time. Yep. Yes. We're not both speaker at the same time now.
Two first. OK dokey. Can I just control?
OK dokey. I'm going to talk about JSON linting and JSON schema validation.
And you all know in KDE, we love to have JSON files for package metadata,
like included in plugins, or also for a K package.
But in case you ever had a syntax error, like
a missing semicolon or a missing comma in a
JSON file the meta object compiler would just
ignore this and print out a warning in the build and this
is of course suboptimal if you forget to double check your build output or to
test your changes and we also have like in kplugin metadata some logic to like
automatically correct some data types if one expects a boolean but but a string is passed in,
and that runtime compatibility is of course a bit ugly.
And we have JSON or documentation for the JSON files,
in different places, but mostly like C++ API docs, and that is sometimes a bit
hard to discover, especially when one like combines multiple JSON schemas.
So, and I have created schemas for the JSON files,
and they are published on the autoconfig website of
KDE and on CI all
the known keys we have are validated so that
if we expect a boolean and to be
the type for some feature flag then it's checked that this is only a boolean
and if it's a string which is like true then it's of course a validation error
and you can You can also specify a more specific schema using the $schema key
and we have various schemas available on the Autoconfig website,
for example for applets and krunner plugins.
And kparts.
And you can also create your own schema utilizing some of the components,
for example you can say you want to extend the kplugin metadata spec to have
some additional entries for your plugin system.
That is what KDE Connect is also doing and there I've created like a local JSON schema.
You can see that we are using the autoconfig website
there to pull in the schema for KPlugin metadata and also define some additional
entries that are specific to KDE Connect and you also say that for example the
KPlugin object and some KDE Connect specific keys are strictly required because
because otherwise a plug-in can't properly be loaded.
And with such a schema, you also get pretty good auto-completion from your language
server, so that you know what you have to type in, and maybe you even get some
suggestions, for example, with system settings categories.
And now it's me. We're not doing JSON anymore. We're doing QML.
So QML is amazing, but it's also runtime, which sucks.
So I write that code, and I made a typo.
I wrote rectangle instead of rectangle, which happens.
I'm not a native in English. So I will go again, and then whoops, whoops, what happened?
So I will go, and I will fix it. And I would say ID rectangle because there's a typo there.
But then I forgot the other typo. There's inline in the penultimate line.
I didn't fix that typo. And that will break. Your code will not run anymore.
If you run it, you will get a runtime warning.
But who wants a runtime warning? Runtime warnings are terrible because they
are on runtime, and we don't test our apps. No, we do.
But it's too late. Maybe it's in a corner case. It's in a place you seldom run,
so you will not see the warning.
If you run kumalint before running the app, you will get also a warning.
It will tell you on line 9, column 24, so it's super, super specific there,
that there is something wrong.
I mean, the warning is not amazing, but it will point you in the right direction.
So how do you use that? You use this new magic thing they added in Qt 6 called,
I don't know what it's called, Qt add QML module, right?
You add that, and then you run make all QML lint, and it will run QML lint over
all your things, and it will give you all the warnings.
Even better, just make your targets depend on that target, right?
So when you run make, it will, at the end of make, or ninja if you're ninjas,
at the end of make or ninja, will run all QML lint, and your build will fail
if you have warnings, right?
That's what we want. We want the CI to be read if you have QML lint warning. So do that today.
Do that yesterday. We need that.
And that's it. We don't have time for questions, but we are all two very pretty
people. He a bit more prettier than me.
So all week here, ask us questions. And yeah, right on time.
Amazing. Thank you very much.