Marcondiro wrote:

Hello @njames93,
After this PR, the class derived from `ClangTidyCheck` created by the script 
`add_new_check.py` overrides `isLanguageVersionSupported` by default, 
restricting the check's scope to `LangOpts.CPlusPlus` code.

Running `clang-tidy/add_new_check.py readability awesome-function-names` 
generates:
```c++
// clang-tools-extra/clang-tidy/readability/AwesomeFunctionNamesCheck.h
class AwesomeFunctionNamesCheck : public ClangTidyCheck {
public:
  [...]
  bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
    return LangOpts.CPlusPlus;
  }
};
```

Is this behavior expected?
If so, 
[`clang-tools-extra/docs/clang-tidy/Contributing.rst`](https://clang.llvm.org/extra/clang-tidy/Contributing.html)
 could be updated accordingly. (It definitely didn't take me a while to figure 
out why my check wasn't working on C code :smile: )

Thank you!

https://github.com/llvm/llvm-project/pull/100129
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to