llvm-project/clang-tools-extra/test
Roman Lebedev 4d37af003f [clang-tidy] readability-function-size: add VariableThreshold param.
Summary:
Pretty straight-forward, just count all the variable declarations in the function's body, and if more than the configured threshold - do complain.

Note that this continues perverse practice of disabling the new option by default.
I'm not certain where is the balance point between not being too noisy, and actually enforcing the good practice.
If we really want to not disable this by default, but also to not cause too many new warnings, we could default to 50 or so.
But that is a lot of variables too...

I was able to find one coding style referencing variable count:
  - https://www.kernel.org/doc/html/v4.15/process/coding-style.html#functions

    > Another measure of the function is the number of local variables. They shouldn’t exceed 5-10, or you’re doing something wrong.

Reviewers: hokein, xazax.hun, JonasToth, aaron.ballman, alexfh

Reviewed By: aaron.ballman

Subscribers: kimgr, Eugene.Zelenko, rnkovacs, cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D44602

llvm-svn: 329902
2018-04-12 12:06:42 +00:00
..
Unit Assume the shared library path variable is LD_LIBRARY_PATH on systems 2018-01-20 14:34:33 +00:00
change-namespace [change-namepsace] make it possible to whitelist symbols so they don't get updated. 2017-02-24 11:54:45 +00:00
clang-apply-replacements [clang-apply-replacements] Convert tooling::Replacements to tooling::AtomicChange for conflict resolving of changes, code cleanup, and code formatting. 2018-04-11 14:39:17 +00:00
clang-doc [clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework" 2018-03-22 23:34:46 +00:00
clang-move [clang-move] Fix test failing due to clang-format change 2018-03-27 13:39:33 +00:00
clang-query
clang-reorder-fields [clang-reorder-fields] Emit warning when reordering breaks member init list dependencies 2017-07-30 06:43:03 +00:00
clang-tidy [clang-tidy] readability-function-size: add VariableThreshold param. 2018-04-12 12:06:42 +00:00
clangd Attempt to fix clangd test on Windows by wildcarding drive letters 2018-03-27 17:44:12 +00:00
include-fixer [cmake] Support running extra clang tool tests without static analyzer 2017-08-29 05:58:08 +00:00
modularize clang-tidy, modularize: return non-zero exit code on errors 2018-03-22 14:18:20 +00:00
pp-trace test: use target triple for the test 2018-02-07 02:27:34 +00:00
.clang-format
CMakeLists.txt [clang-doc] Reland "[clang-doc] Setup clang-doc frontend framework" 2018-03-22 23:34:46 +00:00
lit.cfg run-clang-tidy: forward clang-tidy exit status 2018-03-19 14:43:59 +00:00
lit.site.cfg.in Reland "[lit] Adding config initialization to lit tests in clang-tools-extra" 2018-03-21 18:50:26 +00:00