aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint/findunqualified.h
Commit message (Collapse)AuthorAgeFilesLines
* qmllint: Add flags for toggling warningsMaximilian Goldstein2020-04-301-169/+0
| | | | | | | | Enables all warnings by default and makes it possible to toggle individual ones using command line flags. Change-Id: Ie55f32f646fd9422313977969f9f00b59ee9ad99 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-091-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4executablecompilationunit.cpp src/qml/jsruntime/qv4executablecompilationunit_p.h src/qml/qml/qqmlobjectcreator.cpp src/qml/qml/qqmlpropertycachecreator_p.h src/qml/qml/qqmltypecompiler.cpp src/qml/qml/qqmltypedata.cpp tests/auto/qml/qmlformat/tst_qmlformat.cpp tools/qmllint/scopetree.cpp src/qml/qml/qqmlapplicationengine_p.h Adjusted tools/qmllint/findunqualified.cpp to use newer API Change-Id: Ibfb4678ca39d626d47527265e3c96e43313873d4
| * qmltyperegistrar: Use target instead of template nameMaximilian Goldstein2020-03-261-1/+2
| | | | | | | | | | | | | | | | | | Due to the fact that multiple targets may be present in the same directory we have to ensure they all get a unique qmltypes. Fixes: QTBUG-82710 Change-Id: I4d7966035644b68f7d3330a4c974369503c48bf2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | qmllint: Consistently use shared pointers for ScopeTreeUlf Hermann2020-04-011-6/+6
| | | | | | | | | | | | | | | | | | | | 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>
* | qmllint: Drop support for "ModuleApi"Ulf Hermann2020-03-301-1/+0
| | | | | | | | | | | | | | | | | | This is some ancient, pre-Qt5 way of describing singletons. We don't need it anymore. Change-Id: I6355acf187b8ede4298a7026229a587cd1a12f1b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Use QTypeRevision for all versions and revisionsUlf Hermann2020-02-031-1/+1
|/ | | | | | | | | | | | | | In many places we carry major and minor versions or revisions that are loosely coupled to minor versions. As the Qt minor version resets now, we need to handle these things more systematically. In particular, we need to add a "major" part to revisions. QTypeRevision can express the current major/minor pairs more efficiently and can also be used to add a major version to revisions. This change does not change the semantics, yet, but only replaces the types. Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: parse simple type assertionsUlf Hermann2020-01-131-0/+3
| | | | | Change-Id: Ic24018137d8f989686d4a8f927efb824453d114b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Resolve aliasesUlf Hermann2020-01-131-2/+1
| | | | | Change-Id: Ida53af9774dc72559395064169113d0ee1f47f24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Analyze member accessUlf Hermann2020-01-131-3/+7
| | | | | | | | | We can analyze access to many field member expressions and figure out if the accessed members exist. There are limits to this, of course. Generic JavaScript values are out of scope here. Change-Id: Id2e7613e56f06555cc3a2ba1c51683d9ea0bb84b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: parse JS files for methodsUlf Hermann2020-01-101-2/+6
| | | | | Change-Id: I3888231ac82f9babd51e6332af3c5457bf3c9141 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Handle unversioned import statements in qmldir filesUlf Hermann2019-12-111-1/+2
| | | | | | | | The import statements in qmldir files are not required to have a version attached to them anymore. Change-Id: I925d5f965c73685874c23510cf2e569d1528d8c1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Read app.qmltypes files for extra type resolutionUlf Hermann2019-11-181-2/+13
| | | | | Change-Id: I7f19b39dd65063ae26b93bf1b40b0be0b0e15c6d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qmllint: CleanupUlf Hermann2019-11-181-25/+38
| | | | | | | | | | | | | | | | | qmllint needed to be refactored before we can add any new functionality: * Fix all the (C++) linter warnings * Remove pointless namespaces * Merge ScopeTree and FakeMetaObject into one class * Remove the "Fake" from class and variable names * Remove dead code * Add "We mean it" warnings everywhere * Unify #include style This also "accidentally" fixes the automatic matching of signal handlers in Connections elements to signals in their parent scopes. Change-Id: Idf8daae34dfd6c0ee00da28b017f921da3eba25c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qmllint: Parse variable declarations from PatternElementsUlf Hermann2019-10-011-0/+2
| | | | | | Change-Id: If8b4f5302cc1ee3a4193b354503b304534d7dfd9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Honor --silent argumentUlf Hermann2019-09-191-1/+2
| | | | | | Change-Id: Ie63654139aeb7bfd241be865f33c399c23e08cc3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qmllint: Handle the default import and .ui.qml filesUlf Hermann2019-08-301-1/+1
| | | | | Change-Id: I9d86daa737d30ea0f76af431c59f44d59d4786e4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qmllint: Fail on recursion depth errorsUlf Hermann2019-08-191-0/+1
| | | | | | Change-Id: I815f82ed8c005ed83ceecff6ce80106a9ad9b21d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Improve parent handlingFabian Kosmale2019-07-261-0/+1
| | | | | | | | | | | | | | | | | | - Do not warn about parent access in unknown components This avoids false positive warnings when an imported component could not be found (or when it actually was not imported). We still warn about the component which could not be found, so the user is still informed that something is not right. We also still emit a warning when we know the properties of a component, and parent is not one of them. - Do not recommend the use of parent to address the root components properties. For this to work, we would need to know whether the root component reparents its children or not. Moreover, id lookups are actually faster than parent lookups. Change-Id: I83d0e71e4bf20d34a3e6d836c2b123b2bf0d416e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Extend linter to check for unqualified idsFabian Kosmale2019-07-121-0/+129
The linter has gained a new option (-U/--check-unqualified). If run with this option, it warns about occurrences of unqualified identifiers. Furthermore, it attempts to detect the reason for why the identifier can be used unqalified: - If the id originates from the root element, it suggests to qualify the access either with the root element's id, or with "parent" if applicable. - If the id is the parameter of a signal, it suggests to use functions in the handler, instead of relying on the signal parameters to be "magically" injected into scope. The linter does not attempt to handle with statements, but warns the user instead that they are a bad idea. Change-Id: I9aaf28c37595d84886a1071d49b86799b222a617 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>