| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Fixes: QTBUG-99043
Change-Id: I5ed32d7e78df1e604aaf1bfa2ebda09d5d57b628
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 576fafd1e69429d7387e4c35f6d15fc42af6513e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Some code was not properly wrapped in a namespace.
Change-Id: If70fd9782391309c511b66ae01eae43cb36292ac
Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
|
|
|
|
|
|
|
|
| |
We only support dynamic semantics here.
Task-number: QTBUG-98305
Change-Id: I520da912062917e40e5628d003558fe80b612948
Reviewed-by: Maximilian Goldstein <max.goldstein@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>
|
|
|
|
|
|
|
|
|
| |
... and add a test to qmllint to check that it actually does something.
Task-number: QTBUG-98305
Change-Id: Ib14bc6822cc15200018646c3a0395d0786ec28a8
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Concentrate code likely to be used by more than one pass in a base
class, and adapt the existing users. Also, stub out all the byte code
visitors so that we can easily implement passes that only target part of
the byte code.
Task-number: QTBUG-98305
Change-Id: Ib1e16daf678bf478d9d2d11b3604ded3749f2096
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
| |
If we use the stored type, we lose important information.
Change-Id: I09264642cee8da2bd9103d01488855ebbc5648b5
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>
|
|
|
|
|
|
|
|
| |
qmllint wants only the parenting. It should still warn about shadowing
(once it can).
Change-Id: If49a11cd086643f9626754fdeaaf6a9a7c1bc626
Reviewed-by: Fabian Kosmale <fabian.kosmale@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>
|
|
|
|
|
|
|
|
|
|
| |
When a Connections component is the root component, we are unable to find a parent component which used to lead to a crash.
This change fixes this issue. While this usage cannot be analyzed by qmllint at the moment it should at the very least not lead to a crash.
Fixes: QTBUG-97600
Pick-to: 6.2
Change-Id: If831d9c5ec822693896d48d65689d12628a6690e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Call qt_internal_return_unless_building_tools() directly after
qt_internal_add_tool() to avoid having to special-case code for when
this function only creates imported targets in cross-builds.
Task-number: QTBUG-85084
Change-Id: I5c8f2ecdf4936cfd15cb530e896bc4e5b5531620
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
|
|
|
|
|
|
|
|
|
| |
It was used to determine visibility of messages in the compiler
category, but that category is off by default anyway. If it is on, we
indeed want to see all the messages.
Change-Id: I8b647d0df2c43c3a04235f7b77e7111ea3cb0f31
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 is mostly useful as an replacement for Quick Controls' tst_sanity but might also be useful in some other instances.
Fixes: QTBUG-96572
Change-Id: I5cf414bfeb369cbc394563c5c5ed807599b09a2f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
We need the file name in order to see when the file we're examining is a
qmltypes file.
Change-Id: I72b6c3fe63e721b2b2a116fcafcb55e45b23ae39
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
| |
This file is completely unused now but we forgot to remove it.
Change-Id: I653469be0bfc7ee9288f24d3120223b037b1169a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
UiObjectDefinitions with lower case names are not QML elements, but
grouped properties. Using this information, we can now properly warn
about invalid names for grouped properties.
Pick-to: 6.2
Fixes: QTBUG-96147
Change-Id: Ib02705b28f6324d0b98bb66c09cb4708c18943bd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While migrating to QQmlJSTypeResolver in qmltc, some minor things didn't
match exactly with the currently used type resolver. I'm not planning to
submit those things just yet so it's easier to just make the class
subclassable by making its members protected
On top of this, decouple the QQmlJSImportVisitor from the type resolver
to allow arbitrary visitor to be used for document traversal. This would
anyway be needed for qmltc later on (it seems) as several qmltc-specific
visitor passes are needed, yet they aren't that useful for e.g. qmllint
Change-Id: I9fabcf6c0f2119b0d064bb27157b7085275e7665
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ied9909687640d555fd6ec2f3ce6ace955f603bd1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Change-Id: I68c2b4558473964f20d4946d6b54dd0388abaa0b
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Since all of the warnings have been moved out of checkidentifiers we can now simply remove it.
Change-Id: Ie59e306b69ca397c1e191a0fe379bc084f98cf73
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>
|
|
|
|
|
|
|
| |
Moves the last remaining warnings of checkidentifiers into the qmlcompiler.
Change-Id: I8e4330d3c054620463dc0462c272c3577fd10c8d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Also changes the error message to be a bit clearer about what went wrong and does not involve the unrelated follow up property not being able to be resolved.
Change-Id: I7071ca718b85d1282adacf40ba2bdc62fe5aad6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Change-Id: Ibe7ae9afbfb7754d16cd0ce13185961e9ae2c769
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Change-Id: I6ee8233da9e2c0ea1be37b3961259d2efa38ddfa
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
Moves another warning to qmlcompiler so we can remove checkidentifiers.
Change-Id: If8a72796b205ae1948b9cd9a24f11e62ea28b15a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Moves the remaining logic for handling deprecation warnings to qmlcompiler furthering the goal of removing checkidentifiers for good.
Change-Id: I21ac524ea9c02b2e8c8f65962011976927fd7432
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
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>
|
|
|
|
|
|
|
| |
This is necessary in order for qmllint to still be able to analyze unqualified accesses even when unsupported try/catch blocks occur.
Change-Id: I878ebad4427f4b208432aaeba7433ce0314db107
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
In static mode, we assume that the "parent" property denotes the
document parent. If the document parent then matches the expected type,
we allow access to its properties.
Task-number: QTBUG-93662
Change-Id: Iaf213492aa52571876c80f85faa04d8f76ab1254
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
This is extremely dangerous and offers very little benefit over just
copying the string. QString is implicitly shared after all. If the
string copying really becomes our bottleneck, we can revisit this, but
that won't happen anytime soon.
Change-Id: I274c89aec0a59067d03bb1b58dae4cf2c029b475
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
When following static semantics we assume that properties and methods
cannot be shadowed and just access them. This is independent of wrapping
all non-primitive types in QVariant.
Change-Id: Ic037148c74d5e157ec2ecbaac6089f7d70386638
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
qmldevtools was needed when building with qmake, and to avoid circular
dependencies in the tools (before making QtQml minimal).
Now it can be avoided.
This change will make qmldom, qmlformat, qmlimportscanner and qmllint
depend on QtQml (just like the other Qml tools) and not be always
completely static (qmldevtools was always a static library, QtQml
normally isn't).
Change-Id: Idfa0a70e51f0d4999fb9753121c6c228ae69c9bb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
| |
They are now handled by the logger instead of being done by external classes using the ColorOutput directly.
This will allow for modernizing the logger and for automatically applying those suggested fixes.
Fixes: QTBUG-94170
Change-Id: I90b960d22cb91203b8e8a5c69b0fdaf6fca2fc0c
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|