| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds support for a reading a simple settings file (.qmllint.ini) to set log levels and various other options.
The settings file applies on a per-directory basis so linting files in two subdirectories with different settings will use their respective settings files.
If the directory of the linted file does not contain any settings we search through all parent directories.
This is implemented in a way that qmlformat can also utilize the settings file code.
This makes qmllint more useful for larger projects that might want different settings for different parts of their QML code.
It also allows for better integration in CI checks and pre-commit hooks.
[ChangeLog][General][qmllint] Adds the ability to set linting options via a settings file rather than using command line parameters. Use --write-defaults to generate a template with default values for editing. Use --ignore-settings to disable this feature
Change-Id: I94e4a47916b5dfd16c3a69efdba3858235cab738
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Move all the code from tools/shared into src/qmlcompiler and build a
static library from it so that we can re-use it in external tools.
Change-Id: I7c8d8e59063dc7c711f4072f103a01095e6f5997
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
What we need there is a proper type inference. This should be added
separately. For now, keep the member access chains local in qmllint and
don't pollute ScopeTree with them.
Change-Id: I9f50aa4e54b285bd93e7bd4cd17797509df0c168
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Rather, immediately output the warnings when we encounter them.
Change-Id: I4bd1a5491a47cb0232bfdd4e325f8f122593aa39
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
The specifics of how to warn about the injected identifiers are moved
out of ScopeTree as that is not related to the structure of the scopes.
Change-Id: I26418c3fa492da8339abf045a4034a8464b7bbb8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
QTypeRevision does all we need there.
Change-Id: Ib27ae2d58167a7a45fac31262a45e387d047af89
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This is not a property of the ScopeTree itself, but rather a property of
how qmllint sets up its scopes.
Change-Id: Ifb7c0f1f841046a6ae68e246fbd706f67bedb2af
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We don't use them anymore. Now we can also make all the ScopeTrees const
again as we don't need to modify them anymore after importing.
Change-Id: I3ece767f4f62f06cb0640f1f191eb8d98400717c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
The C++ names are an implementation detail of the importer, and qmllint
has no business messing with them. All the types are supplied as
ScopeTree by the importer now.
Change-Id: I3ef2b5da1dc19f95c7f2a5d80fa1297ba10bef8f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
We don't need to expose them anymore.
Change-Id: Ibb25f688459972f718f9a051fbb7265c7e5b5f92
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
builtins.qmltypes are imported separately now. Any other bare qmltypes
files without qmldir should be specified explicitly. If none are
specified, qmllint looks in the current directory for qmltypes files,
not in all possible import paths. This is still somewhat weird, but
admittedly it's handy for qmltypes files generated for application
binaries. For the same reason, we unconditionally include the current
directory in the list of default import paths. Previously this was done
if no explicit qmltypes files were specified, which makes little sense.
Change-Id: Iaa56f8b40b3ec3045f55928251d7efea5616d23b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
It was only used to make paths passed to importFileOrDirectory absolute.
We can do that before passing them.
Change-Id: I0798d38080596fc6eb314259e81702b81a7743dd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
We want to re-use this logic in other places.
Change-Id: I63cbee86a83265ddd241a4fae9ce8c48f38b5f18
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
We need to check for the baseTypeName, not for the internalName. Also,
this is not really the scope's business but a property of how qmllint
sets up its scopes.
Task-number: QTBUG-87116
Change-Id: I8f0e558a4a5861164c6e85f90e3d88e469ea0769
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Evgeniy Dushistov <dushistov@mail.ru>
|
|
|
|
|
|
|
|
|
| |
Imports are not transitive. qmllint gets this wrong so far. Fixing it
reveals two tests where we use types we haven't imported. Import the
relevant modules.
Change-Id: I45f3229468d54137f97d6b699f3a98a1349bc412
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is just wrong. The types are not visible in QML under their C++
names. Indeed, this way we reveal a number of places where we confuse
the names. Fix those in turn.
Furthermore, one of the tests was incorrect. The qmltypes files did not
contain an export entry for one of the types, and therefore the type was
formally anonymous in QML. However, we did access it via its C++ name.
Fix that by exporting the C++ name.
Change-Id: I8dd96334076b90fb174daf5b285d622f96495f56
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
It was rarely used and only caused confusion. Use internalName instead.
Change-Id: I196b1d77db04a2cb6e3cd0447d34ce9bae0b9cd5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
... and notice that they are misused everywhere.
Change-Id: I2254993dc5d11e967e7e83c6f0efb37fa17744be
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I48601019d0e200eae9d52c3a9db45913cdd9d0f8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
We want to proactively fill in all the types when constructing the
ScopeTree so that we don't have to carry an undue number of imports
around.
Change-Id: I209d88568434c36073c11216dcd052babe5e3dae
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I3e46a62595bfc05cdf9ee4233a27cd744b080ab9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Don't alternate between paths and URIs if we only need the URIs, and
don't rely on casting from ASCII to QString or QChar.
Change-Id: I4c206d5ff488939d5d2d78a3694d8eaf54ec5ec1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
We want to re-use this in other tools.
Change-Id: I2a8cd104d54c1fa9b2898213b0b9e09719e42bca
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Task-number: QTBUG-84319
Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
|
|
|
|
|
|
|
|
| |
gadget types are accessed with value semantics, object types are
accessed with reference semantics, and namespaces are not accessed.
Change-Id: I5eb8f132d729416f28bf94e651f877fc4a9a5c77
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qmltyperegistrar/qmltypesclassdescription.cpp
src/quick/items/qquickrendertarget.h
Change-Id: I9e24d2252a35b8e74af89ad72af796df658167ca
|
| |
| |
| |
| |
| |
| |
| | |
You can have multiple overloads with the same name.
Change-Id: Ifffcc634e96b41f99152092b72b61dad64713b23
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: I9307a6243fdc5bc4f4d43321b41c172082298839
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ScopeTree keeps a weak pointer to its parent scope and strong shared
pointers to its children. Avoid passing bare pointers around, so that we
cannot create multiple shared pointers independently from the same bare
pointer.
Change-Id: Id0faece550b1878363004d843a8fa5c1164794ae
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Iec295b87da413a2b6c741f3d3313c54caf055fd8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|/
|
|
|
|
|
|
|
| |
We want to read qmltypes files and analyze scopes also from other tools.
Furthermore, restructure the shared directory, so that each tool only
includes what it needs.
Change-Id: I96a2dcc8b1c5fac613592fb1867bf51fa5ef3a6e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
We want it to be available early in the build process.
qmltyperegistrar will be required to build qml, quick, and various
imports.
Change-Id: I15b827cd4b322a2bcea2780eeedb8dbe132aa59a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|\
| |
| |
| | |
Change-Id: Iaa7dbbe9926d25cfb1b1c51e7013e58cb71d86b5
|
|
|
|
|
|
|
|
|
|
|
| |
This reuses the ResourceFileMapper and extends it slightly to return
full paths on request. Subsequently, this is moved into a shared
directory inside tools.
Fixes: QTBUG-55259
Change-Id: Ice5fc68d03b767a4185742e182556ab4290bd28d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
We can use the new moc JSON output to collect all meta-objects at build
time and, for those that include QML element registration meta-data,
generate code that automatically registers these types with QML. This
eliminates the need to call qmlRegisterType manually.
For now this generates free-standing functions (per module) that need to
be called manually. This is intended as an intermediate step.
Task-number: QTBUG-68796
Change-Id: Ib414eef9757344feee488ebc7388f957b975347f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|