diff options
Diffstat (limited to 'Help')
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 1 | ||||
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_tgt/LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst | 29 | ||||
-rw-r--r-- | Help/release/dev/clang-tidy-export-fixes-dir.rst | 8 | ||||
-rw-r--r-- | Help/variable/CMAKE_LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst | 15 |
5 files changed, 54 insertions, 0 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index e9ee681..93c6d3e 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -301,6 +301,7 @@ Properties on Targets /prop_tgt/JOB_POOL_PRECOMPILE_HEADER /prop_tgt/LABELS /prop_tgt/LANG_CLANG_TIDY + /prop_tgt/LANG_CLANG_TIDY_EXPORT_FIXES_DIR /prop_tgt/LANG_COMPILER_LAUNCHER /prop_tgt/LANG_CPPCHECK /prop_tgt/LANG_CPPLINT diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index d66bb2b..2a1e017 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -450,6 +450,7 @@ Variables that Control the Build /variable/CMAKE_INTERPROCEDURAL_OPTIMIZATION_CONFIG /variable/CMAKE_IOS_INSTALL_COMBINED /variable/CMAKE_LANG_CLANG_TIDY + /variable/CMAKE_LANG_CLANG_TIDY_EXPORT_FIXES_DIR /variable/CMAKE_LANG_COMPILER_LAUNCHER /variable/CMAKE_LANG_CPPCHECK /variable/CMAKE_LANG_CPPLINT diff --git a/Help/prop_tgt/LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst b/Help/prop_tgt/LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst new file mode 100644 index 0000000..265fade --- /dev/null +++ b/Help/prop_tgt/LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst @@ -0,0 +1,29 @@ +<LANG>_CLANG_TIDY_EXPORT_FIXES_DIR +---------------------------------- + +.. versionadded:: 3.26 + +This property is implemented only when ``<LANG>`` is ``C``, ``CXX``, ``OBJC`` +or ``OBJCXX``, and only has an effect when :prop_tgt:`<LANG>_CLANG_TIDY` is +set. + +Specify a directory for the ``clang-tidy`` tool to put ``.yaml`` files +containing its suggested changes in. This can be used for automated mass +refactoring by ``clang-tidy``. Each object file that gets compiled will have a +corresponding ``.yaml`` file in this directory. After the build is completed, +you can run ``clang-apply-replacements`` on this directory to simultaneously +apply all suggested changes to the code base. If this property is not an +absolute directory, it is assumed to be relative to the target's binary +directory. This property should be preferred over adding an ``--export-fixes`` +or ``--fix`` argument directly to the :prop_tgt:`<LANG>_CLANG_TIDY` property. + +At generate-time, in order to avoid passing stale fixes from old code to +``clang-apply-replacements``, CMake will search the directory for any ``.yaml`` +files that won't be generated by ``clang-tidy`` during the build, and delete +them. In addition, just before running ``clang-tidy`` on a file, CMake will +delete that file's corresponding ``.yaml`` file in case ``clang-tidy`` doesn't +produce any fixes. + +This property is initialized by the value of +the :variable:`CMAKE_<LANG>_CLANG_TIDY_EXPORT_FIXES_DIR` variable if it is set +when a target is created. diff --git a/Help/release/dev/clang-tidy-export-fixes-dir.rst b/Help/release/dev/clang-tidy-export-fixes-dir.rst new file mode 100644 index 0000000..edb7ed5 --- /dev/null +++ b/Help/release/dev/clang-tidy-export-fixes-dir.rst @@ -0,0 +1,8 @@ +clang-tidy-export-fixes-dir +--------------------------- + +* A new :prop_tgt:`<LANG>_CLANG_TIDY_EXPORT_FIXES_DIR` target property was + created to allow the ``clang-tidy`` tool to export its suggested fixes to a + set of ``.yaml`` files. A new + :variable:`CMAKE_<LANG>_CLANG_TIDY_EXPORT_FIXES_DIR` variable was created to + initialize this property. diff --git a/Help/variable/CMAKE_LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst b/Help/variable/CMAKE_LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst new file mode 100644 index 0000000..60b7f40 --- /dev/null +++ b/Help/variable/CMAKE_LANG_CLANG_TIDY_EXPORT_FIXES_DIR.rst @@ -0,0 +1,15 @@ +CMAKE_<LANG>_CLANG_TIDY_EXPORT_FIXES_DIR +---------------------------------------- + +.. versionadded:: 3.26 + +Default value for :prop_tgt:`<LANG>_CLANG_TIDY_EXPORT_FIXES_DIR` target +property when ``<LANG>`` is ``C``, ``CXX``, ``OBJC`` or ``OBJCXX``. + +This variable is used to initialize the property on each target as it is +created. For example: + +.. code-block:: cmake + + set(CMAKE_CXX_CLANG_TIDY_EXPORT_FIXES_DIR clang-tidy-fixes) + add_executable(foo foo.cxx) |