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