Skip to content

Commit 130dfcd

Browse files
authored
MINOR: [C++][clang-tidy] Disable modernize-use-nodiscard check (apache#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 <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
1 parent 8aca43d commit 130dfcd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

.clang-tidy

+8-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
---
18-
Checks: 'clang-diagnostic-*,clang-analyzer-*,-clang-analyzer-alpha*,google-*,modernize-*,-modernize-use-trailing-return-type'
18+
Checks: |
19+
clang-diagnostic-*,
20+
clang-analyzer-*,
21+
-clang-analyzer-alpha*,
22+
google-*,
23+
modernize-*,
24+
-modernize-use-trailing-return-type,
25+
-modernize-use-nodiscard,
1926
# produce HeaderFilterRegex from cpp/build-support/lint_exclusions.txt with:
2027
# echo -n '^('; sed -e 's/*/\.*/g' cpp/build-support/lint_exclusions.txt | tr '\n' '|'; echo ')$'
2128
HeaderFilterRegex: '^(.*codegen.*|.*_generated.*|.*windows_compatibility.h|.*pyarrow_api.h|.*pyarrow_lib.h|.*python/config.h|.*python/platform.h|.*thirdparty/ae/.*|.*vendored/.*|.*RcppExports.cpp.*|)$'

0 commit comments

Comments
 (0)