Commit graph

13 commits

Author SHA1 Message Date
Aaron Gyes
c077230b11 .clang_tidy: turn off cert-dcl21-cpp, add some others.
cert-dcl21-cpp is pretty bogus, doing as it says can force a copy.

https://reviews.llvm.org/D33531

Turn on some good ones.
2021-09-24 09:30:25 -07:00
Johannes Altmanninger
686d64cf05 Disable some clang-tidy lints with false positives
One warns about using system() which we only use in test code (we're all adults):

	src/fish_tests.cpp:2015:9: warning: calling 'system' uses a command processor [cert-env33-c]
	    if (system("mkdir -p test/fish_expand_test/bb/")) err(L"mkdir failed");

Some conversion warnings that don't seem very useful:

	src/input_common.cpp:181:20: warning: 'signed char' to 'wint_t' (aka 'unsigned int') conversion; consider casting to 'unsigned char' first. [cert-str34-c]
	        wint_t b = evt.get_char();

Warning about varargs doesn't make sense, because some of our functions use std::vswprintf() internally.

	src/ast.cpp:486:10: warning: do not define a C-style variadic function; consider using a function parameter pack or currying instead [cert-dcl50-cpp]
	    void internal_error(const char *func, const wchar_t *fmt, ...) const {

Finally, what seems like a false positive; "va" is initialized by va_copy:

	src/common.cpp:468:18: warning: Function 'vswprintf' is called with an uninitialized va_list argument [clang-analyzer-valist.Uninitialized]
	        status = std::vswprintf(buff, size / sizeof(wchar_t), format, va);
2020-12-29 16:31:43 +01:00
Rosen Penev
60c4b254d2 .clang-tidy: don't check for variables starting with _
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-25 22:36:32 -07:00
Johannes Altmanninger
6d30a9f9e4 Disable clang-tidy lint about adding noexcept to move constructors
See #7356. We don't use exceptions, so this lint seems useless.
2020-09-28 20:46:56 +02:00
Rosen Penev
385b069eb2 [clang-tidy] remove pointless public
Found with readability-redundant-access-specifiers

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:43 +02:00
Rosen Penev
68467eeca7 [clang-tidy] remove redundant string initialization
Found with readability-redundant-string-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
473a5250ae [clang-tidy] change several member functions to const
Found with readability-make-member-function-const

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
312b575424 [clang-tidy] numeric literals to uppercase
Found with hicpp-uppercase-literal-suffix

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
8d3377e923 [clang-tidy] Use C++ using instead of typedef
Found with modernize-use-using

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
be036c443e [clang-tidy] use bool literals
Found with modernize-use-bool-literals

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
27f607ae8b [clang-tidy] use range based loop
Found with modernize-loop-convert

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
220f0a132d [clang-tidy] use auto when casting
Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Lior Stern
d6e2110cdf Add a clang-tidy file. 2020-04-04 14:47:58 -07:00