1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340
|
Version 1.17
~~~~~~~~~~~~
Released: 2025-02-15
Bugfixes:
* Fix non-pod-static check emitting warning for each entry of a container
* Fix use-arrow-operator-instead-of-data emitting false positive when value is casted
* Do not whitelist QVariant for detaching-temporary. QVariant::toString will provide a QString that is not detached
* detaching-temporary properly checks conditions when more than two method calls are chained
* Fixits for detaching-temporary/detaching-member are more reliable with fixit ranges for operator calls
* When using QT_NAMESPACE, clazy properly handles Qt classes being in this specific namespace
* Fix wrong replacement method for QMap::operator[]
* Make project compile with LLVM22. qhash-namespace, fully-qualified-moc-types, old-style-connect tests are fixed
* Adjust readlock-detaching check to work properly with Qt 6.11 changes
* Move qstring-ref to manuallevel since it is not compatible with Qt6
Features:
* New checks:
- compare-member-check: Checks whether comparison operators do not use all member variables of a class.
Notes:
* C++20 is now required for compilation
* qt6-\* porting checks are removed
Version 1.16
~~~~~~~~~~~~
Released: 2025-09-03
Bugfixes:
* unused-result-check: Fix crash when method decleration can not be resolved
* use-chrono-in-qtimer: Fix crash when using precompiled headers
* qt6-qhash-signature: Adapt check to use more proper logic for casts and fix crash in edgecases
* Ensure that clang21 works properly with clazy and produces same line/letter number as before (mismatches with operator calls)
* non-pod-global-static: Fix false positive with Q_IMPORT_PLUGIN in Qt-6.10
Features:
* Clazy can finally be integrated into clang-tidy - one command to rule
them all! All checks can be enabled using "clazy-<checkname>". For example:
`clazy-qstring-arg,clazy-qfileinfo-exists`, enabling all checks using
`clazy-*` will also enable manual checks. It is recommended to be more granular.
The plugin can be loaded using `-load=ClazyClangTidy.so`, for this, the plugin
must be in the LD_LIBRARY_PATH. Otherwise, an absolute path may be specified.
* isempty-vs-count now provides fixits for all scenarios. Also, cases where
the length is compared using "== 0", "< 1", "> 0" are now reported and have fixits.
* qt6-\* Porting checks are considered deprecated now and will be removed in the next release of clazy
* detaching-temporary and detaching-member checks provide fixits for methods that have const coutnerparts
* NOLINT/NOLINTNEXTLINE/NOLINTBEGIN/NOLINTEND all work in clazy now as
expected. Individual clazy checks can be disabled when using a "clazy-"
prefix. For example "NOLINTNEXTLINE(clazy-qfileinfo-exists, clazy-qstring-arg)"
Version 1.15
~~~~~~~~~~~~
Released: 2025-06-12
Bugfixes:
* install-event-filter: Fix crash when there is no child at the given depth. BUG: 464372
* fully-qualified-moc-types: Fix enum/enum class not being evaluated. BUG: 423780
* Fixed crash in qstring-comparison-to-implicit-char. BUG: 502458
* Fixed crash when fully-qualified-moc-types encounters signals with expressions like "std::bitset<int(8)>"
* Fixed crash in qvariant-template-instantiation
Features:
* New checks:
- readlock-detaching
* Update minimum Clang/LLVM to 19
* `clazy-standalone --version` contains git version ( output of `git describe`) if it is not a tagged commit
* Added missing methods to checks for detaching temporary/member lists or maps
Version 1.14
~~~~~~~~~~~~
Released: 2025-04-27
Notes:
* Clazy warnings for the following line can be disabled, for example: clazy:exclude-next-line=check1,check2
* Support for compilation against Clang 20
* increase verbosity of some warning messages
- checks `function-args-by-value` and `function-args-by-ref`: add function name and parameter name to warning message
- checks `unused-non-trivial-variable` and `non-pod-global-static`: add variable name to warning message
Features:
* New checks:
- qbytearray-conversion-to-c-style
Version 1.13
~~~~~~~~~~~~
Released: 2024-12-28
Features:
* New Checks:
- used-qunused-variable
Bugfixes:
* qstring-arg check provides a fix-it
* Fixed unused-non-trivial-variable to not warn when [[maybe_unused]] set
* Fixed qstring-arg for upcoming Qt 6.9
* Fixed fully-qualified-moc-types false positive for const modifiers of generic arguments
* Silence false positive non-pod-global-static warning for QML module initialization
* Fix function-args-by-value false positive that would cause compile error
in copy constructors, assignment operators and equal checks
* False positives for `Q_EMIT(someSignal())` are now fixed
Version 1.12
~~~~~~~~~~~~
Released: 2024-06-30
Features:
* New Checks:
- qt-keyword-emit
- sanitize-inline-keyword
Version 1.11
~~~~~~~~~~~~
Released: 2022-01-21
Features:
* New Checks:
- use-arrow-operator-instead-of-data
- use-static-qregularexpression
- unexpected-flag-enumerator-value
- Removed inefficient-qlist check (Fixed in Qt6)
Version 1.10
~~~~~~~~~~~~
Released: 2021-07-20
Features:
* Requires C++17
Bugfixes:
* Fixed a -Wclazy-lambda-in-connect false-positive
* Fixed crash in copyable-polymorphic when PCH was enabled
Version 1.9
~~~~~~~~~~~
Released: 2021-01-10
Bugfixes:
* Fixed clazy slowdown introduced in 1.8. I can be up to 4x faster now.
* range-loop was split in range-loop-detach and range-loop-reference
* Fixed -Wclazy-connect-non-signal false positives
Version 1.8
~~~~~~~~~~~
Released: 2020-11-22
Features:
* New Checks:
- qt6-qhash-signature
- qt6-header-fixes
- qt6-deprecated-api-fixes
- use-chrono-in-qtimer
- fixit for missing-qobject-macro
Version 1.7
~~~~~~~~~~~
Released: 2020-06-29
Features:
* New Checks:
- overloaded signal
- invalid JNI signatures
- qstring-comparison-to-implicit-char
- qt6-qlatin1string-to-u
- heap-allocated-small-trivial-type: less false-positives
Bugfixes:
* connect-non-signal: Fix case where it didn't find the pmf
* qstring-arg warns when using QLatin1String::arg(int), as it casts to QChar
Notes:
* Building clazy itself is 30% faster
Version 1.6
~~~~~~~~~~~
Released: 2019-10-12
Features:
* New Checks:
- heap-allocated-small-trivial-type
- signal-with-return-value
- qproperty-type-mismatch, contributed by Jean-Michaƫl Celerier
Notes:
* Removed level3. Moved all level3 checks to manual level. Doesn't make sense to enable all of them.
Each one must be carefully considered.
* Minimum LLVM was bumped to 5.0
* Clazy no longer rewrites files directly, to avoid races when parallel invocations change the same header.
* Clazy now exports a yaml file with the replacements, to be applied with clang-apply-replacements.
The same way other clang tooling does it.
* The way to enable code rewrite is now: -Xclang -plugin-arg-clazy -Xclang export-fixes for clang
or -export-fixes=somefile.yaml for clazy-standalone
* All other fixit arguments and fixit env variables were removed
* Thanks to Christian Gagneraud for contributing the fixit yaml exporter!
Bugfixes:
* Fixed regressions with LLVM 9.0
* Fixit infrastructure was overhauled
Version 1.5
~~~~~~~~~~~
Released: 2019-01-31
Features:
* New Checks:
- ifndef-define-typo
- lowercase-qml-type-name
- qrequiredresult-candidates
* New Fixits:
- range-loop now supports adding missing refs or const-ref
- range-loop now supports adding qAsConst()
- function-args-by-ref now adding missing refs or const-ref (experimental)
- Introduced CLAZY_FIXIT_SUFFIX env variable
Notes:
* Removed support for the obscure -DCLAZY_BUILD_UTILS_LIB to simplify the CMakeLists.txt
* Renamed the clazy plugin from ClangLazy.so to ClazyPlugin.so
- fully-qualified-moc-types now warns for slot/invokable return values too.
They need to be fully qualified for QML.
Bugfixes:
* Fixed a crash (clang assert) in raw-environment-function
Version 1.4
~~~~~~~~~~~
Released: 2018-09-23
Features:
* New Checks:
- connect-by-name
- skipped-base-method
- qstring-varargs
- fully-qualified-moc-types
- qt-keywords, with fixit included
- qhash-with-char-pointer-key
- wrong-qevent-cast
- static-pmf
- raw-environment-function
- empty-qstringliteral
* auto-unexpected-qstringbuilder now also warns for lambdas returning QStringBuilder
Notes:
* performance optimizations
* Added -header-filter=<regex> option to clazy-standalone. Only headers matching the regexp will
have warnings, besides the .cpp file from the translation unit, which is never filtered out.
* Added -ignore-dirs=<regex> option to clazy-standalone, and its CLAZY_IGNORE_DIRS env variable equivalent.
* Added CLAZY_HEADER_FILTER env variable which adds above functionality to both clazy and clazy-standalone
* unused-non-trivial-variable got unused-non-trivial-variable-no-whitelist option
* unused-non-trivial-variable got user-blacklist and user-whitelist support
* container-inside-loop is now a manual check instead of level2
* HiddenLevel was renamed to ManualLevel
* connect-3arg-lambda now warns when passing a lambda to QTimer::singleShot() or QMenu::addAction()
without a context object
* old-style-connect warns for QMenu::addAction() and QMessageBox::open() too now
Version 1.3
~~~~~~~~~~~
Released: 2017-11-26
Features:
* New checks:
- thread-with-slots
- connect-3arg-lambda
- qproperty-without-notify
- virtual-signal
- overridden-signal
- qhash-namespace
- const-signal-or-slot
- lambda-unique-connection
Notes:
* missing-qobject-macro is now a level2 check, instead of level1. Because, people can omit Q_OBJECT intentionally.
* Added -only-qt option, which will make clazy bailout early on non-Qt files.
For this purpose, the definition of a Qt file is whenever -DQT_CORE_LIB is passed,
which is usually the case in most build systems.
* Added -qt-developer option, when building Qt with clazy it will honour specific guidelines for Qt,
which are not many right now but the list will grow.
Version 1.2
~~~~~~~~~~~
Released: 2017-07-08
Features:
* New checks:
- install-event-filter
- qcolor-from-literal
- strict-iterators
- connect-not-normalized
Bugfixes:
* clazy-standalone executable. Allows to run clazy against a JSON compilation database
instead of as a plugin. clang-tidy doesn't support loading external modules (https://github.com/llvm/llvm-project/issues/32086)
so this is a good workaround.
* qt-compat mode. Allows to disable Qt5 specific checks by passing -Xclang -plugin-arg-clazy -Xclang qt4-compat
* returning-data-from-temporary now checks for temporary QByteArrays casting to char* when returned
- returning-data-from-temporary now checks for assignment too, not only return statements
* unused-non-trivial-variable now warns for unused QList, QVector and many more types
* ASTMatchers based checks are now supported
* clang 3.7 was dropped due to ASTMatchers source incompatibilities.
* Use clazy v1.1 for clang >= 3.6 support
* clazylib.so no longer gets built by default, only the plugin (ClangLazy.so)
gets built. Pass -DCLAZY_BUILD_UTILS_LIB=ON to enable the utils library if
you're developing tools using clazy's convenience functions, which you're
probably not.
* CLAZY_INSTALL_NO_HEADERS option was removed. Either install the utils library
and headers or nothing at all. By default nothing is installed, except
the plugin and man pages.
Version 1.1
~~~~~~~~~~~
Released: 2017-02-20
Features:
* macOS and Windows support
* New checks:
- child-event-qobject-cast
- ctor-missing-parent-argument
- returning-data-from-temporary
- qt-macros
- base-class-event
- connect-non-signal
- incorrect-emit
- tr-non-literal
* Fixes against:
- clang 4.0
- Qt 5.9
Notes:
* 60% performance improvement
* Fixed many false positives
Version 1.0
~~~~~~~~~~~
Released: 2016-09-12
Version 0.0.1
~~~~~~~~~~~~~
Released: 2015-06-10
Notes:
* First release
|