[all-commits] [llvm/llvm-project] a37f7a: [clang-tidy] Add type annotations to add_new_check...

Nicolas van Kempen via All-commits all-commits at lists.llvm.org
Fri Sep 6 07:48:15 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a37f7ae6268b25ff1673c94a7294ab242b9a11d8
      https://github.com/llvm/llvm-project/commit/a37f7ae6268b25ff1673c94a7294ab242b9a11d8
  Author: Nicolas van Kempen <nvankemp at gmail.com>
  Date:   2024-09-06 (Fri, 06 Sep 2024)

  Changed paths:
    M clang-tools-extra/clang-tidy/add_new_check.py

  Log Message:
  -----------
  [clang-tidy] Add type annotations to add_new_check.py, fix minor bug (#106801)

```
> python3 -m mypy --strict clang-tools-extra/clang-tidy/add_new_check.py
Success: no issues found in 1 source file
```

Also fix a bug when `--standard` is not provided on the command line:
the
generated test case has a `None` causing issues:
```
> python3 clang-tools-extra/clang-tidy/add_new_check.py performance XXX
Updating clang-tools-extra/clang-tidy/performance/CMakeLists.txt...
Creating clang-tools-extra/clang-tidy/performance/XxxCheck.h...
Creating clang-tools-extra/clang-tidy/performance/XxxCheck.cpp...
Updating clang-tools-extra/clang-tidy/performance/PerformanceTidyModule.cpp...
Updating clang-tools-extra/docs/ReleaseNotes.rst...
Creating clang-tools-extra/test/clang-tidy/checkers/performance/XXX.cpp...
Creating clang-tools-extra/docs/clang-tidy/checks/performance/XXX.rst...
Updating clang-tools-extra/docs/clang-tidy/checks/list.rst...
Done. Now it's your turn!

> head -n 1 clang-tools-extra/test/clang-tidy/checkers/performance/XXX.cpp
// RUN: %check_clang_tidy None%s performance-XXX %t
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list