mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-01 12:18:36 -06:00
Merge topic 'skip-linting'
775c369420Autogen: set SKIP_LINTING ON for generated filesb480315e0cTargetGenerator: Add SKIP_LINTING source property993dde925fTargetGenerator: Factor out generation of code check rules023af4ab2fImprove Const Correctness Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8467
This commit is contained in:
@@ -559,6 +559,7 @@ Properties on Source Files
|
||||
/prop_sf/SKIP_AUTOUIC
|
||||
/prop_sf/SKIP_PRECOMPILE_HEADERS
|
||||
/prop_sf/SKIP_UNITY_BUILD_INCLUSION
|
||||
/prop_sf/SKIP_LINTING
|
||||
/prop_sf/Swift_DEPENDENCIES_FILE
|
||||
/prop_sf/Swift_DIAGNOSTICS_FILE
|
||||
/prop_sf/SYMBOLIC
|
||||
|
||||
41
Help/prop_sf/SKIP_LINTING.rst
Normal file
41
Help/prop_sf/SKIP_LINTING.rst
Normal file
@@ -0,0 +1,41 @@
|
||||
SKIP_LINTING
|
||||
------------
|
||||
|
||||
.. versionadded:: 3.27
|
||||
|
||||
This property allows you to exclude a specific source file
|
||||
from the linting process. The linting process involves running
|
||||
tools such as :prop_tgt:`<LANG>_CPPLINT`, :prop_tgt:`<LANG>_CLANG_TIDY`,
|
||||
:prop_tgt:`<LANG>_CPPCHECK`, and :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE`
|
||||
on the source files. By setting `SKIP_LINTING` on a source file,
|
||||
the mentioned linting tools will not be executed for that
|
||||
particular file.
|
||||
|
||||
EXAMPLE
|
||||
^^^^^^^
|
||||
|
||||
Consider a `C++` project that includes multiple source files,
|
||||
such as `main.cpp`, `things.cpp`, and `generatedBindings.cpp`.
|
||||
In this example, you want to exclude the `generatedBindings.cpp`
|
||||
file from the linting process. To achieve this, you can utilize
|
||||
the `SKIP_LINTING` property with the `set_source_files_properties`
|
||||
command as shown below:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
add_executable(MyApp main.cpp things.cpp generatedBindings.cpp)
|
||||
|
||||
set_source_files_properties(generatedBindings.cpp PROPERTIES
|
||||
SKIP_LINTING ON
|
||||
)
|
||||
|
||||
In the provided code snippet, the `SKIP_LINTING` property is set to `ON`
|
||||
for the `generatedBindings.cpp` source file. As a result, when the linting
|
||||
tools, such as :prop_tgt:`<LANG>_CPPLINT`, :prop_tgt:`<LANG>_CLANG_TIDY`,
|
||||
:prop_tgt:`<LANG>_CPPCHECK`, and :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE`,
|
||||
are executed, they will skip analyzing the `generatedBindings.cpp` file.
|
||||
|
||||
By using the `SKIP_LINTING` property, you can selectively exclude specific
|
||||
source files from the linting process. This allows you to focus the
|
||||
linting tools on the relevant parts of your project, enhancing the efficiency
|
||||
and effectiveness of the linting workflow.
|
||||
@@ -30,3 +30,10 @@ when a target is created.
|
||||
|
||||
This property supports
|
||||
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||||
|
||||
:prop_sf:`SKIP_LINTING` can be set on individual source files to exclude
|
||||
them from the linting process, which includes tools like
|
||||
:prop_tgt:`<LANG>_CPPLINT`, :prop_tgt:`<LANG>_CLANG_TIDY`,
|
||||
:prop_tgt:`<LANG>_CPPCHECK`, and :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE`.
|
||||
When :prop_sf:`SKIP_LINTING` is set on a source file, the mentioned tools
|
||||
will not be run on that specific file.
|
||||
|
||||
@@ -20,3 +20,10 @@ created.
|
||||
|
||||
This property supports
|
||||
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||||
|
||||
:prop_sf:`SKIP_LINTING` can be set on individual source files to exclude
|
||||
them from the linting process, which includes tools like
|
||||
:prop_tgt:`<LANG>_CPPLINT`, :prop_tgt:`<LANG>_CLANG_TIDY`,
|
||||
:prop_tgt:`<LANG>_CPPCHECK`, and :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE`.
|
||||
When :prop_sf:`SKIP_LINTING` is set on a source file, the mentioned tools
|
||||
will not be run on that specific file.
|
||||
|
||||
@@ -18,3 +18,10 @@ created.
|
||||
|
||||
This property supports
|
||||
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||||
|
||||
:prop_sf:`SKIP_LINTING` can be set on individual source files to exclude
|
||||
them from the linting process, which includes tools like
|
||||
:prop_tgt:`<LANG>_CPPLINT`, :prop_tgt:`<LANG>_CLANG_TIDY`,
|
||||
:prop_tgt:`<LANG>_CPPCHECK`, and :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE`.
|
||||
When :prop_sf:`SKIP_LINTING` is set on a source file, the mentioned tools
|
||||
will not be run on that specific file.
|
||||
|
||||
@@ -18,3 +18,10 @@ when a target is created.
|
||||
|
||||
This property supports
|
||||
:manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||||
|
||||
:prop_sf:`SKIP_LINTING` can be set on individual source files to exclude
|
||||
them from the linting process, which includes tools like
|
||||
:prop_tgt:`<LANG>_CPPLINT`, :prop_tgt:`<LANG>_CLANG_TIDY`,
|
||||
:prop_tgt:`<LANG>_CPPCHECK`, and :prop_tgt:`<LANG>_INCLUDE_WHAT_YOU_USE`.
|
||||
When :prop_sf:`SKIP_LINTING` is set on a source file, the mentioned tools
|
||||
will not be run on that specific file.
|
||||
|
||||
5
Help/release/dev/skip-linting.rst
Normal file
5
Help/release/dev/skip-linting.rst
Normal file
@@ -0,0 +1,5 @@
|
||||
skip-linting
|
||||
------------
|
||||
|
||||
* The :prop_sf:`SKIP_LINTING` source file property was added to suppress
|
||||
target-wide code checks on specific sources.
|
||||
Reference in New Issue
Block a user