[Development] Codifying the .qml License Header Exemption

Mitch Curtis mitch.curtis at digia.com
Mon Oct 21 10:37:36 CEST 2013

On 09/21/2013 12:15 AM, Alan Alpert wrote:
> A while ago it came up that the rules for license headers in QML files
> isn't clearly defined. Here's my suggestion for how to define it, and if
> the project likes the idea we can get a legal check and then fix up the
> infrastructure to follow (sanity bot and license-check test).
> Current rule is roughly "can be skipped in tests". It's that way for a
> reason, QML unit tests necessarily involve lots of trivially simple QML
> files to test just one specific part of the language. We have separate
> tests for comment parsing, we don't need to extend the CI runs with a
> ton of "double-checking" here ;) .
> Since I'm pretty sure the concept is supposed to be only bothering for
> non-trivial code (because bothering to add headers to trivial code is
> useless, boring, and depressing) adding a size limit would be the
> easiest way to make this automatable. Looking at the file sizes, I
> recommend excluding QML files under "tests" from requiring a license
> header if they have <=15 LoC. If those few lines are really ingenious
> contributors are recommended to add a header anyways and there's nothing
> wrong with adding the headers. But if you don't add a header for such a
> small file in tests (and the reviewer agrees the files are trivial),
> then you don't get blocked.
> Note that the abundance of tiny, trivial QML files is a tests specific
> problem and so I think this exemption should only apply to the tests
> subdir. All doc/example code should still have license headers checked.
> If this sounds good to people, I'll prepare patches to update the
> system. Not patches that add/remove license headers to existing tests.
> For reference, this recent patch got a ton of bogus warnings:
> https://codereview.qt-project.org/#change,63591
> And this patch is blocked because the current exemption is tests/auto
> specific: https://codereview.qt-project.org/#change,64331
> when tests/benchmarks is obviously in the same boat (and test manual is
> on the fence, so should be left to human judgement).
> Appendix A: Graphs of data (LoC in .qml files after removing all
> headers) which informed this suggestion:
> QML file size under tests
> Inline image 1
> Same data, zoomed in to see that spike in better res. 15 seems like the
> sweet spot in the data (while still being a fairly trivial amount of
> formatted QML code).
> Inline image 2
> Length of .qml files in the examples sub-tree for comparision (same
> x-axis scale as the 1st graph):
> Inline image 3
> With a 40 line license header, and looking at those graphs, I think
> we're looking at 60kB of license headers on trivial files if we force
> all the <=15 LoC test files to have licenses. If nothing else, think of
> the poor people on dialup ;) because that's above the "large file
> warning" the bot hands out so freely.
> --
> Alan Alpert
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

Are you still interested in doing this, Alan?

More information about the Development mailing list