mirror of
https://github.com/neovim/neovim.git
synced 2026-01-03 09:56:25 +10:00
build: slience some unwanted clang-tidy warnings
This commit is contained in:
@@ -3,6 +3,10 @@ Checks: >
|
||||
Enable all warnings by default. This ensures we don't miss new and useful
|
||||
warnings when a new version of clang-tidy is dropped.
|
||||
|
||||
To list all available checks:
|
||||
|
||||
clang-tidy --list-checks --checks="*"
|
||||
|
||||
IMPORTANT
|
||||
clang-tidy doesn't support comments but we can simulate comments by just
|
||||
writing text directly here. These are then interpreted as warnings and will
|
||||
@@ -55,12 +59,14 @@ Checks: >
|
||||
-misc-misplaced-const,
|
||||
-misc-no-recursion,
|
||||
-performance-no-int-to-ptr,
|
||||
-portability-avoid-pragma-once,
|
||||
-readability-function-cognitive-complexity,
|
||||
-readability-identifier-length,
|
||||
-readability-magic-numbers,
|
||||
-readability-math-missing-parentheses,
|
||||
-readability-redundant-declaration, Conflicts with our header generation scripts,
|
||||
-readability-suspicious-call-argument,
|
||||
-readability-use-concise-preprocessor-directives,
|
||||
|
||||
Aliases. These are just duplicates of other warnings and should always be ignored,
|
||||
-bugprone-narrowing-conversions,
|
||||
|
||||
@@ -55,22 +55,22 @@ FileComparison path_full_compare(char *const s1, char *const s2, const bool chec
|
||||
const bool expandenv)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
char exp1[MAXPATHL];
|
||||
char expanded1[MAXPATHL];
|
||||
char full1[MAXPATHL];
|
||||
char full2[MAXPATHL];
|
||||
FileID file_id_1, file_id_2;
|
||||
|
||||
if (expandenv) {
|
||||
expand_env(s1, exp1, MAXPATHL);
|
||||
expand_env(s1, expanded1, MAXPATHL);
|
||||
} else {
|
||||
xstrlcpy(exp1, s1, MAXPATHL);
|
||||
xstrlcpy(expanded1, s1, MAXPATHL);
|
||||
}
|
||||
bool id_ok_1 = os_fileid(exp1, &file_id_1);
|
||||
bool id_ok_1 = os_fileid(expanded1, &file_id_1);
|
||||
bool id_ok_2 = os_fileid(s2, &file_id_2);
|
||||
if (!id_ok_1 && !id_ok_2) {
|
||||
// If os_fileid() doesn't work, may compare the names.
|
||||
if (checkname) {
|
||||
vim_FullName(exp1, full1, MAXPATHL, false);
|
||||
vim_FullName(expanded1, full1, MAXPATHL, false);
|
||||
vim_FullName(s2, full2, MAXPATHL, false);
|
||||
if (path_fnamecmp(full1, full2) == 0) {
|
||||
return kEqualFileNames;
|
||||
|
||||
Reference in New Issue
Block a user