[clang-tools-extra] [clang-tidy][readability-identifier-length] Add a line count threshold (PR #185319)

via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 8 18:35:04 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE LINT COMMENT: clang-tidy-->


:warning: C/C++ code linter, clang-tidy found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

```bash

git diff -U0 origin/main...HEAD -- clang-tools-extra/clang-tidy/readability/IdentifierLengthCheck.cpp clang-tools-extra/clang-tidy/readability/IdentifierLengthCheck.h |
python3 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py   -path build -p1 -quiet
```

</details>

<details>
<summary>
View the output from clang-tidy here.
</summary>

```
clang-tools-extra/clang-tidy/readability/IdentifierLengthCheck.cpp:102:13: warning: use auto when initializing with a template cast to avoid duplicating the type name [modernize-use-auto]
  102 |       const DeclRefExpr *Use = Result.Nodes.getNodeAs<DeclRefExpr>("varUse");
      |             ^~~~~~~~~~~
      |             auto
clang-tools-extra/clang-tidy/readability/IdentifierLengthCheck.cpp:105:9: warning: variable 'UseLine' of type 'unsigned int' can be declared 'const' [misc-const-correctness]
  105 |         unsigned UseLine = Result.SourceManager->getSpellingLineNumber(Loc);
      |         ^
      |                  const
```

</details>


https://github.com/llvm/llvm-project/pull/185319


More information about the cfe-commits mailing list