| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
They may contain backslashes.
Pick-to: 6.7 6.5
Fixes: QTBUG-125393
Change-Id: Ifd8c97c44b036ab64a221775a7fe6316445f6cf8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Add a -E commandline option for qmllint to enable using environment
variables. For now, this only allows using QML_IMPORT_PATH and
QML2_IMPORT_PATH to pass import paths to qmllint.
Task-number: QTBUG-114969
Change-Id: Ie6baf9c8035703a456ba1e7e575ba424f89d287a
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove a misplaced pair of braces that made --ignore-settings ignore the
parsing of command line options like "-I", "-E" and "--bare".
Do not populate the settings from a settings file when --ignore-settings
is set to make QQmlToolingSettings::isSet() always return false.
Discovered while working on QTBUG-114969.
Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-114969
Change-Id: Ia8719b33af4a2ebdcb2b81194e0c028164775327
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
|
|
|
|
|
| |
Change-Id: Ic95509efbd7ce33d6e98a52eef3dd319cd328306
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
That's what --bare promises after all.
Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-115478
Change-Id: Iae7563203709bc28b7bcaa0da68cad1826c035d9
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adapt CMake code to use a response file instead of a long string of
arguments when calling the various qmllint targets.
Avoids long command line errors on Windows.
Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-119675
Change-Id: I49041ffff2724fb36b8127b2a08127a9b740db7d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds abstractions for QML Elements, Bindings, Methods and
Properties. This abstraction layer avoids exposing internal details and
should be more suited for static analysis tasks. It is now possible to
write qmllint plugins without including private headers.
As a drive-by, change tst_qmllint:verifyJsRoot to open files in text
mode instead of binary. This fixes an issue where line endings cause
issues on Windows.
Fixes: QTBUG-102276
Change-Id: I6b6e53f1e0078734a18f3aa51807fbe875b375f0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Qmlls was completely implemented in the ./tools directory, which made
its code complicated to test and try out. Also, it required some "dirty"
hacks in the actual tests (including files from others targets to be
able to use them) and made testing new features for qmlls more
complicated.
To remedy this, the qmlls code was split into a tool (qmlls) and
a static library (QmlLSPrivate). The tool only contains
tools/qmlls/qmllanguageservertool.cpp (which has the qmlls main method)
and links to QmlLSPrivate, that contains all the other qmlls-related
code. This way, the tests can also link to QmlLSPrivate and test out
individual functions there without needing to include files from other
targets.
Also rename all the files to make syncqt happy (adding "_p" to headers
and prepending "q" to headers and files and includeguards), and use
QString::fromUtf8() to silence the QString()-constructor deprecation
warnings.
On the way, move tools/shared/qqmltoolingsettings.* into its own private
static library, instead of recompiling it for each tool that requires
it. Move the qqmltoolingsettings stuff into the qt namespace to be
usable.
Also, add qmlls as a dependency to the qmlls tests to avoid testing an
outdated qmlls-binary.
This commit prepares qmlls's code to implement the go-to and
find-usages features.
Task-number: QTBUG-109006
Change-Id: I91eed689c68a0c53fb88006de335b0f852cc1a83
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Those are just as important for modules as for single files.
Pick-to: 6.5
Change-Id: I201d62c61988abc2dfba6300a1cfc355203fec75
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are many ways to "hide" the qmldir from the engine at run time,
which turns singletons into regular types. While all of this is invalid,
we should not assert on it, but rather produce a legible warning.
Furthermore, sharpen the importing of extra modules from qrc as implicit
imports. We should really only import modules the file in question can
ever be part of. Otherwise we needlessly produce the above situation and
hide legitimate warning messages.
Amends commit 7517c1b3ae9aa92f36b19d74a4b2de5e8531309b.
Now we need to teach our tools about the default import paths in the
resorurce file system. They cannot guess any type they may find in any
resource file anymore.
Pick-to: 6.5
Task-number: QTBUG-106929
Change-Id: Ic8c02396d10830a7f461e8a81649bb8c9a1add1f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Amends 5c04d174282a9a36ce12b26e1807d3d5051a7f33.
The behavior of qmllint changed in the above-mentioned commit, as it
started expecting a file argument for the --json option. Before, it was
not expecting any and always writing to stdout.
Document the new behavior in the docs and in the --help command,
especially the part about using '-' to restore the old behavior.
Fixes: QTBUG-108913
Pick-to: 6.4
Change-Id: I3a69a794a5362a575437d3d832d6e038c7a0755a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Use QHashSeed::setDeterministicGlobalSeed() instead
Task-number: QTBUG-105102
Change-Id: I1d13f3872b335ff9998f7c4538d3b9c3c77fe232
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change allows for modules to be linted via the -M flag.
This will check whether an individual module has a sound qmldir and
qmltypes. It will also verify whether all its types and the types of
properties can be resolved.
It does not lint individual QML files.
[ChangeLog][qmllint][New Feature] Individual modules can now be linted
via the -M option
Fixes: QTBUG-103264
Change-Id: I3ced4b0bc05358e9216c9819f1dca67af909405e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change makes qmljslogger use an ID based system for categorizing
logging entries instead of using an enum. This allows plugins to
register their own logging categories after the fact.
It's also necessary for us to later show the warning ID when
printing warnings and for creating documentation for each ID entry.
Currently not every ID maps cleanly to only one type of warning,
this has to be cleaned up in a follow-up change.
Task-number: QTBUG-103453
Change-Id: I4cac6be7ca165b938e0ea032d077823bf17baf75
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-101408
Change-Id: Ic925751b73f52d8fa5add5cacc52d6dd6ea2dc27
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Display whether a plugin is built-in or not when listing them via
--list-plugins.
Fixes: QTBUG-102419
Change-Id: I2b2dc40933402ec9e4a1dd6153971e4371ef76e8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Adds a command line option and settings entry in order to
disable individual plugins. Previously you could only
disable all of them.
Fixes: QTBUG-102420
Change-Id: I5a35093c32f5f86eef1e31dd42b77c95e38bb01f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds an additional _qmllint_json target for use in CI settings and a
all_qmllint_json target to run all of them.
Since the output of ninja sub-commands can not be directly processed by
piping it into a script, the output of the qmllint command is instead
written to ${target}_qmllint.json.
[ChangeLog][qmllint][Important Behavior Changes] The --json option now has
a mandatory file argument and writes its output there. You may also pass
"-" to write it to stdout.
Fixes: QTBUG-95157
Change-Id: I3806c4113235d3aa06d3b3310e1cc7b0171b3eca
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously it was just a static library that we linked qmllint against
now it's properly installed in the qmllint plugins folder and can be
utilized in the language server as well.
Fixes: QTBUG-102278
Change-Id: I4aec42d1e2ba113237ee5ba148085e69b7251506
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This plugin is meant to contain all the linting logic that is specific
to QtQuick. For now it only contains a pass that verifies that layout
items don't use anchors.
Original-patch-by: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: Ie75351442596c9c42ae05ab11b3156eff4e56ad5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Integrates the plugin and pass infrastructure into qmlcompiler and qmllint proper.
Plugins are searched for in the "qmllint" subfolder of the Qt installation's plugin
directory. In addition we also support loading statically linked plugins.
[ChangeLog][qmllint][New Feature] qmllint can now be extended via plugins. Use --plugins
to get a list of available plugins.
Original-patch-by: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: I75a09dd978fc7724aca4931f055cc71c7ced971b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
The fix and dry-run argument had broken help entries, this change fixes
this issue.
Change-Id: I744592e610f3d9941a2a54e4153cb2a92fbe9f1b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We now support automatically applying fix suggestions that don't
need any additional user input. This allows us to automatically
solve issues such as unqualified access and multiline strings.
[ChangeLog][qmllint][New Feature] Added the ability to automatically
fix some warnings, use -f to automatically fix your files or add
--dry-run to see what changes would be made first.
Change-Id: I2dc7587137d74267f60c08bb94a035f1a85a62b1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Since all of the superfluous components of qmllint have been
removed now, we can just move what little custom linter logic
remains to qmlcompiler.
Change-Id: I91c752cb895e7d6c6f2dd4e2ccafb6cd05afa225
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
qmllint's utility is rather limited when we can pass it neither the
qmldir nor qmltypes files. Instead of trying to somehow handle the case
with ifdefs, move the feature check into the build system and
completely disable the tool if we lack the parser.
The same holds for qmltc, which is already completely unusable without
the parser (and just prints an error message if build without the
feature enabled).
Change-Id: I31828bb7d551caeaffd1974d1dff14a25446ce95
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
If a file sets pragma Strict, it expects to be fully compiler
compliant, so let's enable the warnings for that by default.
Fixes: QTBUG-97081
Change-Id: I0b388f64d99846ee0c03e24397b3a997d4b0173b
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tools will still grudgingly accept qmltypes files being passed via
the -i option. We generally expect qmldir files, though. Ignoring the
qmldir file and importing the qmltypes directly, ignores qmldir imports,
dependencies and other component entries. This leads to unresolvable
types.
[ChangeLog][QML Tooling] qmllint expects qmldir files, not qmltypes
files to be passed via the -i option now. This enables it to see the
imports and dependencies of the module being imported. For backwards
compatibility it still accepts qmltypes files, with a warning.
Pick-to: 6.3
Fixes: QTBUG-99043
Change-Id: I5ed32d7e78df1e604aaf1bfa2ebda09d5d57b628
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Fix suggestions are now attached to the warnings they are caused by
and are also accessible via JSON.
This allows us to use the qmllint library for more of tst_qmllint,
greatly improving performance.
Change-Id: Idd0398028bff1272a75dc1193d2c15a25d335dbf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
We do want to see the output if the cleanQmlCode test fails.
Change-Id: I6b7e9d3412af9fffac68d2e394418de2faf09626
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
The API now allows for specifying the file contents yourself for either
on-the-fly editing or if you have your own caching scheme.
It's now also possible to access the logger directly in order to read
diagnostic messages instead of structured JSON output.
Change-Id: I4eb8440c7b25068cd09f28a5f3cbd0a318774522
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is necessary step for both making qmllint viable for use in
controls' tst_sanity, as well as for integration with the
language server.
As an additional upside it allows us to run our tests up to 10x faster.
Eventually we want to integrate all of this into qmlcompiler but due
to the state of some of the code we will keep qmllint in a separate
library as to keep qmlcompiler tidier.
Change-Id: Ic057ef0cd4424d28aa05e517d74280a442ec9c5a
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
| |
Disabling uses the keyword "disable" not "disabled".
Fixed in this change.
Pick-to: 6.2
Change-Id: I544a543043627121a11ca3ab56ad3d967707efb6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some IDEs might want to parse qmllints logging messages directly instead
of using the structured JSON output.
For these a hidden --absolute-path option has been introduced so the
messages can more easily be mapped to the actual files.
Task-number: QTCREATORBUG-17224
Change-Id: I23c4272a45adcb2bf7aeb6ae7b130839b9f05b72
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Do not rely on QLoggingCategory being implicitly declared through
other headers.
Pick-to: 6.2
Change-Id: Ib6cda43f281d31a7127dd591be2540fb00a0a699
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously some settings were only checked before any settings file
could be loaded, thus resulting in misapplied settings.
Now every settings option will be applied on a per-file basis as it
should be.
Pick-to: 6.2
Change-Id: Ib7c8a8d7dbec2d4379f634488e3899e1746c0c51
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Previously builtins not being found would lead to an endless loop that
crashes qmllint. Now missing builtins are handled gracefully,
aborting linting without crashing as this an unrecoverable error.
Change-Id: Ia585b1e0e5c972dad0eeabf8df06edf71eaea0c7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We want it to be mutable even where Codegen itself is const. Therefore,
it needs to live outside Codegen.
Change-Id: Ie4997118a1fdf8d60bd5670baa506ed0bfb98bad
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
| |
Change-Id: Ifcbf81b5ee04753af916dc1ef1177617785c961d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
This puts them right below the description of warning levels and hopefully makes the whole help easier to read.
Task-number: QTBUG-95971
Change-Id: Iff6062e700c2c277fc4c69a8130ba6b2dd5e35c0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QQmlImportVisitor was accepting ctor paratemeters for the QQmlJSLogger,
creating own logger internally. This seems wrong since in that case we
kind of have separate logger for visitor and type resolver (among other
entities)
On top of this, the import visitor had a silent logging by default
(and the QQmlJSLogger is not silent on the contrary) which in fact hid
some issues that should've been reported by qmllint (but they weren't)
For consistency, the silent logger is still used. And the ultimate fix
would be to use FindWarningsVisitor instead of QQmlJSImportVisitor
as currently we do 2 AST traversals in qmllint
Change-Id: I4c54b76d130e7e8f31c90a148edc1c02f7e86ab8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Another step to making checkidentifiers obsolete.
Change-Id: I14be7491387200101b66e0930faf16e9b61d4159
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Do not rely on checkidentifiers to provide unqualified access warnings anymore. Using the type propagator ought to be more accurate and will help remove the relatively hacky checkidentifiers code completely later on.
Change-Id: I40cc040b9455962abbd2ec84cdb494fcec1ab79d
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
In order to properly integrate the type propagator into qmllint we need to use the logging system instead of qWarning().
Change-Id: Ie9840066f8afa3d7f8a63a69444b6dc20c41a706
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This change helps bring in type inference and compiler warnings previously only generated by qmlcachegen+.
These warnings are disabled by default and have to be enabled manually via the --compiler option.
Also makes the logger handle zero length SourceLocations properly by just highlighting the entire line instead of hitting an assert.
Change-Id: Iebad6e9236214d9367f97487e7b5787592edab7d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to use the source tree files, qmllint needs to know where they
will end up in the resource system. The source files could be at any
arbitrary location and have their resource path set by a
QT_RESOURCE_ALIAS source file property. Therefore, we have to give the
generated .qrc files to qmllint so it can work out where each source
file will end up.
The qmllint command previously only supported a single --resource
option, but now we need to potentially pass more than one .qrc file.
Extend qmllint to allow multiple --resource options to be given, in
the same way that multiple -I options can be given.
Task-number: QTBUG-94761
Pick-to: 6.2
Change-Id: Ibeb6541e1f54bea6eeeccd07426dd238b0459ff2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
| |
qmllint now supports logging levels of different severities. Still lacking a good way to toggle the verbosity more granularly though (i.e. disabling only info messages while still receiving the rest).
Change-Id: I71abddcdf1adf60315a87d776af8085acf7aeffe
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
| |
We kept these around for compatibility in Qt 6.2 but now it's time to get rid off them
[ChangeLog][QtQuick][qmllint] The deprecated --no-[category] options from Qt 6.1 are now fully removed, use the new style of options as outlined in --help.
Change-Id: Ie564a8262fdefa2685fe86b59b46dc3aa25d4958
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
We shouldn't keep advertising options we're deprecating anyway, just warn when they are still passed to qmllint.
Change-Id: Ibe53c51fc473719d021f912243921b6511ebd2f4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
|
|
|
|
|
|
|
|
| |
Use the Qt version instead of 1.0. Especially important since qmllint allows for mixing and matching the tool with other Qt versions.
Change-Id: Ib485578f93d8e61f2aa76bb610c3fd87ed71cd60
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|