[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-14 Thread Congcong Cai via cfe-commits
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

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-14 Thread Congcong Cai via cfe-commits
@@ -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:

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-14 Thread Congcong Cai via cfe-commits
@@ -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:

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Piotr Zegar via cfe-commits
@@ -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:

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Piotr Zegar via cfe-commits
@@ -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:

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Piotr Zegar via cfe-commits
@@ -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

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Piotr Zegar via cfe-commits
@@ -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

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Piotr Zegar via cfe-commits
@@ -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

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Piotr Zegar via cfe-commits
@@ -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:

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Piotr Zegar via cfe-commits
@@ -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:

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Piotr Zegar via cfe-commits
@@ -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:

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Piotr Zegar via cfe-commits
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

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Piotr Zegar via cfe-commits
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

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread via cfe-commits
@@ -0,0 +1,20 @@ +.. title:: clang-tidy - readability-avoid-nested-conditional-operator + +readability-avoid-nested-conditional-operator += EugeneZelenko wrote: Please adjust length.

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread via cfe-commits
@@ -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

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread via cfe-commits
@@ -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:

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread via cfe-commits
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:

[clang-tools-extra] [clang-tidy]Add new check readability-avoid-nested-conditional-operator (PR #78022)

2024-01-13 Thread Congcong Cai via cfe-commits
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