Merge #36859 refactor: clint.py => clint.lua

This commit is contained in:
Justin M. Keyes
2025-12-08 01:58:58 -05:00
committed by GitHub
11 changed files with 1843 additions and 2453 deletions

1584
src/clint.lua Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -928,12 +928,13 @@ else()
endif()
add_glob_target(
TARGET lintc-clint
COMMAND ${PROJECT_SOURCE_DIR}/src/clint.py
FLAGS --output=${LINT_OUTPUT_FORMAT}
COMMAND $<TARGET_FILE:nvim_bin>
FLAGS --clean -l ${PROJECT_SOURCE_DIR}/src/clint.lua --output=${LINT_OUTPUT_FORMAT}
FILES ${LINT_NVIM_SOURCES}
EXCLUDE
tui/terminfo_defs.h
xxd/xxd.c)
add_dependencies(lintc-clint nvim_bin)
set(UNCRUSTIFY_PRG ${DEPS_BIN_DIR}/uncrustify)
set(UNCRUSTIFY_CONFIG ${PROJECT_SOURCE_DIR}/src/uncrustify.cfg)

View File

@@ -116,8 +116,8 @@ bool tv_in_free_unref_items = false;
const char *const tv_empty_string = "";
//{{{1 Lists
//{{{2 List item
// Lists:
// List item:
/// Allocate a list item
///
@@ -150,7 +150,7 @@ listitem_T *tv_list_item_remove(list_T *const l, listitem_T *const item)
return next_item;
}
//{{{2 List watchers
// List watchers:
/// Add a watcher to a list
///
@@ -198,7 +198,7 @@ static void tv_list_watch_fix(list_T *const l, const listitem_T *const item)
}
}
//{{{2 Alloc/free
// Alloc/free:
/// Allocate an empty list
///
@@ -335,7 +335,7 @@ void tv_list_unref(list_T *const l)
}
}
//{{{2 Add/remove
// Add/remove:
/// Remove items "item" to "item2" from list "l"
///
@@ -578,7 +578,7 @@ void tv_list_append_number(list_T *const l, const varnumber_T n)
});
}
//{{{2 Operations on the whole list
// Operations on the whole list:
/// Make a copy of list
///
@@ -1569,7 +1569,7 @@ void tv_list_reverse(list_T *const l)
l->lv_idx = l->lv_len - l->lv_idx - 1;
}
//{{{2 Indexing/searching
// Indexing/searching:
/// Locate item with a given index in a list and return it
///
@@ -1719,8 +1719,8 @@ int tv_list_idx_of_item(const list_T *const l, const listitem_T *const item)
return -1;
}
//{{{1 Dictionaries
//{{{2 Dictionary watchers
// Dictionaries:
// Dictionary watchers:
/// Perform all necessary cleanup for a `DictWatcher` instance
///
@@ -2014,7 +2014,7 @@ void tv_dict_watcher_notify(dict_T *const dict, const char *const key, typval_T
}
}
//{{{2 Dictionary item
// Dictionary item:
/// Allocate a dictionary item
///
@@ -2094,7 +2094,7 @@ void tv_dict_item_remove(dict_T *const dict, dictitem_T *const item)
tv_dict_item_free(item);
}
//{{{2 Alloc/free
// Alloc/free:
/// Allocate an empty dictionary.
/// Caller should take care of the reference count.
@@ -2204,7 +2204,7 @@ void tv_dict_unref(dict_T *const d)
}
}
//{{{2 Indexing/searching
// Indexing/searching:
/// Find item in dictionary
///
@@ -2428,7 +2428,7 @@ int tv_dict_wrong_func_name(dict_T *d, typval_T *tv, const char *name)
&& var_wrong_func_name(name, true);
}
//{{{2 dict_add*
// dict_add*:
/// Add item to dictionary
///
@@ -2659,7 +2659,7 @@ int tv_dict_add_func(dict_T *const d, const char *const key, const size_t key_le
return OK;
}
//{{{2 Operations on the whole dict
// Operations on the whole dict:
/// Clear all the keys of a Dictionary. "d" remains a valid empty Dictionary.
///
@@ -2868,8 +2868,8 @@ void tv_dict_set_keys_readonly(dict_T *const dict)
});
}
//{{{1 Blobs
//{{{2 Alloc/free
// Blobs:
// Alloc/free:
/// Allocate an empty blob.
///
@@ -2906,7 +2906,7 @@ void tv_blob_unref(blob_T *const b)
}
}
//{{{2 Operations on the whole blob
// Operations on the whole blob:
/// Check whether two blobs are equal.
///
@@ -3172,9 +3172,9 @@ void f_list2blob(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
});
}
//{{{1 Generic typval operations
//{{{2 Init/alloc/clear
//{{{3 Alloc
// Generic typval operations:
// Init/alloc/clear:
// Alloc:
/// Allocate an empty list for a return value
///
@@ -3367,7 +3367,7 @@ void tv_blob_copy(blob_T *const from, typval_T *const to)
}
}
//{{{3 Clear
// Clear:
#define TYPVAL_ENCODE_ALLOW_SPECIALS false
#define TYPVAL_ENCODE_CHECK_BEFORE
@@ -3634,7 +3634,7 @@ void tv_clear(typval_T *const tv)
assert(evn_ret == OK);
}
//{{{3 Free
// Free:
/// Free allocated Vimscript object and value stored inside
///
@@ -3674,7 +3674,7 @@ void tv_free(typval_T *tv)
xfree(tv);
}
//{{{3 Copy
// Copy:
/// Copy typval from one location to another
///
@@ -3730,7 +3730,7 @@ void tv_copy(const typval_T *const from, typval_T *const to)
}
}
//{{{2 Locks
// Locks:
/// Lock or unlock an item
///
@@ -3909,7 +3909,7 @@ bool value_check_lock(VarLockStatus lock, const char *name, size_t name_len)
return true;
}
//{{{2 Comparison
// Comparison:
static int tv_equal_recurse_limit;
@@ -4000,7 +4000,7 @@ bool tv_equal(typval_T *const tv1, typval_T *const tv2, const bool ic)
return false;
}
//{{{2 Type checks
// Type checks:
/// Check that given value is a number or string
///
@@ -4137,7 +4137,7 @@ bool tv_check_str(const typval_T *const tv)
return false;
}
//{{{2 Get
// Get:
/// Get the number value of a Vimscript object
///

View File

@@ -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;

View File

@@ -1028,7 +1028,7 @@ sp_before_for_colon = ignore # ignore/add/remove/force
sp_extern_paren = ignore # ignore/add/remove/force
# Add or remove space after the opening of a C++ comment, as in '// <here> A'.
sp_cmt_cpp_start = ignore # ignore/add/remove/force
sp_cmt_cpp_start = add # ignore/add/remove/force
# remove space after the '//' and the pvs command '-V1234',
# only works with sp_cmt_cpp_start set to add or force.