summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-05-18 13:24:01 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-05-18 13:24:17 (GMT)
commit4d5c32fa2cd0170617d1ab489b17ec7fee87b89d (patch)
tree62d181c52c9750f9dfce98765f1f029762afa277 /Help
parentb6c45d28b2e2cd45fe69fc68c6ca2f1fefe9afd9 (diff)
parent775c369420ece1500c2de46b83d5564480d05f70 (diff)
downloadCMake-4d5c32fa2cd0170617d1ab489b17ec7fee87b89d.zip
CMake-4d5c32fa2cd0170617d1ab489b17ec7fee87b89d.tar.gz
CMake-4d5c32fa2cd0170617d1ab489b17ec7fee87b89d.tar.bz2
Merge topic 'skip-linting'
775c369420 Autogen: set SKIP_LINTING ON for generated files b480315e0c TargetGenerator: Add SKIP_LINTING source property 993dde925f TargetGenerator: Factor out generation of code check rules 023af4ab2f Improve Const Correctness Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !8467
Diffstat (limited to 'Help')
-rw-r--r--Help/manual/cmake-properties.7.rst1
-rw-r--r--Help/prop_sf/SKIP_LINTING.rst41
-rw-r--r--Help/prop_tgt/LANG_CLANG_TIDY.rst7
-rw-r--r--Help/prop_tgt/LANG_CPPCHECK.rst7
-rw-r--r--Help/prop_tgt/LANG_CPPLINT.rst7
-rw-r--r--Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst7
-rw-r--r--Help/release/dev/skip-linting.rst5
7 files changed, 75 insertions, 0 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 8ee5573..b8026ef 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -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
diff --git a/Help/prop_sf/SKIP_LINTING.rst b/Help/prop_sf/SKIP_LINTING.rst
new file mode 100644
index 0000000..2be47cb
--- /dev/null
+++ b/Help/prop_sf/SKIP_LINTING.rst
@@ -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.
diff --git a/Help/prop_tgt/LANG_CLANG_TIDY.rst b/Help/prop_tgt/LANG_CLANG_TIDY.rst
index 1e10933..0e46643 100644
--- a/Help/prop_tgt/LANG_CLANG_TIDY.rst
+++ b/Help/prop_tgt/LANG_CLANG_TIDY.rst
@@ -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.
diff --git a/Help/prop_tgt/LANG_CPPCHECK.rst b/Help/prop_tgt/LANG_CPPCHECK.rst
index 0b2dee6..3ab2b58 100644
--- a/Help/prop_tgt/LANG_CPPCHECK.rst
+++ b/Help/prop_tgt/LANG_CPPCHECK.rst
@@ -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.
diff --git a/Help/prop_tgt/LANG_CPPLINT.rst b/Help/prop_tgt/LANG_CPPLINT.rst
index 38a1669..cb230d3 100644
--- a/Help/prop_tgt/LANG_CPPLINT.rst
+++ b/Help/prop_tgt/LANG_CPPLINT.rst
@@ -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.
diff --git a/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst b/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
index 19b97f7..8fbe84a 100644
--- a/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
+++ b/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
@@ -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.
diff --git a/Help/release/dev/skip-linting.rst b/Help/release/dev/skip-linting.rst
new file mode 100644
index 0000000..199571c
--- /dev/null
+++ b/Help/release/dev/skip-linting.rst
@@ -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.