https://github.com/HerrCai0907 updated
https://github.com/llvm/llvm-project/pull/78022
>From 0988bb25a35e5d50b44bf53d459098777280c3e5 Mon Sep 17 00:00:00 2001
From: Congcong Cai
Date: Sat, 13 Jan 2024 16:00:16 +0800
Subject: [PATCH 1/2] [clang-tidy]Add new check
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.cpp - clang-tidy --===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.cpp - clang-tidy --===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.cpp - clang-tidy --===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.cpp - clang-tidy --===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,20 @@
+.. title:: clang-tidy - readability-avoid-nested-conditional-operator
+
+readability-avoid-nested-conditional-operator
+=
+
+Finds nested conditional operator.
+
+Nested conditional operators lead code hard to
@@ -337,6 +337,7 @@ Clang-Tidy Checks
:doc:`portability-simd-intrinsics `,
:doc:`portability-std-allocator-const `,
:doc:`readability-avoid-const-params-in-decls
`, "Yes"
+ :doc:`readability-avoid-nested-conditional-operator
`, "Yes"
PiotrZSL
@@ -0,0 +1,20 @@
+.. title:: clang-tidy - readability-avoid-nested-conditional-operator
+
+readability-avoid-nested-conditional-operator
+=
+
+Finds nested conditional operator.
PiotrZSL wrote:
maybe:
`Identifies
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.cpp - clang-tidy --===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.cpp - clang-tidy --===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
@@ -0,0 +1,56 @@
+//===--- AvoidNestedConditionalOperatorCheck.cpp - clang-tidy --===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
https://github.com/PiotrZSL requested changes to this pull request.
Just few nits, from functional point of view check is good even now.
https://github.com/llvm/llvm-project/pull/78022
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/PiotrZSL edited
https://github.com/llvm/llvm-project/pull/78022
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,20 @@
+.. title:: clang-tidy - readability-avoid-nested-conditional-operator
+
+readability-avoid-nested-conditional-operator
+=
EugeneZelenko wrote:
Please adjust length.
@@ -0,0 +1,33 @@
+//===--- AvoidNestedConditionalOperatorCheck.h - clang-tidy --*- C++ -*-===//
EugeneZelenko wrote:
Please add `-`.
https://github.com/llvm/llvm-project/pull/78022
___
cfe-commits mailing list
@@ -0,0 +1,33 @@
+//===--- AvoidNestedConditionalOperatorCheck.h - clang-tidy --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier:
llvmbot wrote:
@llvm/pr-subscribers-clang-tidy
Author: Congcong Cai (HerrCai0907)
Changes
Finds nested conditional operator.
Nested conditional operators lead code hard to understand, so they should be
splited as several statement and stored in temporary varibale.
---
Full diff:
https://github.com/HerrCai0907 created
https://github.com/llvm/llvm-project/pull/78022
Finds nested conditional operator.
Nested conditional operators lead code hard to understand, so they should be
splited as several statement and stored in temporary varibale.
>From
18 matches
Mail list logo