diff --git a/.clang-tidy b/.clang-tidy index 5b5e177ce2..5114ad2241 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -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, diff --git a/src/nvim/path.c b/src/nvim/path.c index 8efe8520fd..42f4d479da 100644 --- a/src/nvim/path.c +++ b/src/nvim/path.c @@ -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;