You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ap...@apache.org on 2023/01/23 15:19:34 UTC

[arrow] branch master updated: MINOR: [C++][clang-tidy] Disable modernize-use-nodiscard check (#33837)

This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 130dfcd1a1 MINOR: [C++][clang-tidy] Disable modernize-use-nodiscard check  (#33837)
130dfcd1a1 is described below

commit 130dfcd1a10429362d67dc7ea6f9331a29179f05
Author: Felipe Oliveira Carvalho <fe...@gmail.com>
AuthorDate: Mon Jan 23 12:19:27 2023 -0300

    MINOR: [C++][clang-tidy] Disable modernize-use-nodiscard check  (#33837)
    
    Not all functions that return a value should have a `[[nodiscard]]`.
    
    `[[nodiscard]]` adds noise and is better used for functions that:
     1. Return a `Status` or some kind of error code
     2. Have a confusing name like the STL container's `empty()`. The STL uses  `[[nodiscard]]` for `empty()` so people are less likely to call it believing it has the same effect of `clear()`.
    
    Authored-by: Felipe Oliveira Carvalho <fe...@gmail.com>
    Signed-off-by: Antoine Pitrou <an...@python.org>
---
 .clang-tidy | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/.clang-tidy b/.clang-tidy
index 8b2c16746f..10800f4250 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -15,7 +15,14 @@
 # specific language governing permissions and limitations
 # under the License.
 ---
-Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,google-*,modernize-*,-modernize-use-trailing-return-type'
+Checks: |
+  clang-diagnostic-*,
+  clang-analyzer-*,
+  -clang-analyzer-alpha*,
+  google-*,
+  modernize-*,
+  -modernize-use-trailing-return-type,
+  -modernize-use-nodiscard,
 # produce HeaderFilterRegex from cpp/build-support/lint_exclusions.txt with:
 # echo -n '^('; sed -e 's/*/\.*/g' cpp/build-support/lint_exclusions.txt | tr '\n' '|'; echo ')$'
 HeaderFilterRegex: '^(.*codegen.*|.*_generated.*|.*windows_compatibility.h|.*pyarrow_api.h|.*pyarrow_lib.h|.*python/config.h|.*python/platform.h|.*thirdparty/ae/.*|.*vendored/.*|.*RcppExports.cpp.*|)$'