mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-03 06:41:14 -03:00
run codebase through clang-tidy
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
committed by
ridiculousfish
parent
60c4b254d2
commit
334be56021
@@ -108,7 +108,7 @@ static void builtin_complete_remove(const wcstring_list_t &cmds, const wcstring_
|
||||
}
|
||||
}
|
||||
|
||||
static void builtin_complete_print(const wcstring cmd, io_streams_t &streams, parser_t &parser) {
|
||||
static void builtin_complete_print(const wcstring &cmd, io_streams_t &streams, parser_t &parser) {
|
||||
const wcstring repr = complete_print(cmd);
|
||||
|
||||
// colorize if interactive
|
||||
|
||||
@@ -404,10 +404,10 @@ class completer_t {
|
||||
std::set<wcstring> visited_wrapped_commands{};
|
||||
};
|
||||
|
||||
void complete_custom(const wcstring &cmd, const wcstring &cmdline, custom_arg_data_t *arg_data);
|
||||
void complete_custom(const wcstring &cmd, const wcstring &cmdline, custom_arg_data_t *ad);
|
||||
|
||||
void walk_wrap_chain(const wcstring &cmd, const wcstring &cmdline, source_range_t cmd_range,
|
||||
custom_arg_data_t *arg_data);
|
||||
void walk_wrap_chain(const wcstring &cmd, const wcstring &cmdline, source_range_t cmdrange,
|
||||
custom_arg_data_t *ad);
|
||||
|
||||
cleanup_t apply_var_assignments(const wcstring_list_t &var_assignments);
|
||||
|
||||
@@ -432,7 +432,7 @@ static owning_lock<autoload_t> completion_autoloader{autoload_t(L"fish_complete_
|
||||
|
||||
/// Create a new completion entry.
|
||||
void append_completion(completion_list_t *completions, wcstring comp, wcstring desc,
|
||||
complete_flags_t flags, string_fuzzy_match_t &&match) {
|
||||
complete_flags_t flags, string_fuzzy_match_t match) {
|
||||
completions->emplace_back(std::move(comp), std::move(desc), match, flags);
|
||||
}
|
||||
|
||||
@@ -1224,8 +1224,7 @@ bool completer_t::complete_variable(const wcstring &str, size_t start_offset) {
|
||||
}
|
||||
|
||||
// Append matching environment variables
|
||||
append_completion(&this->completions, std::move(comp), std::move(desc), flags,
|
||||
std::move(match));
|
||||
append_completion(&this->completions, std::move(comp), std::move(desc), flags, match);
|
||||
|
||||
res = true;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ bool complete_is_valid_argument(const wcstring &str, const wcstring &opt, const
|
||||
/// \param flags completion flags
|
||||
void append_completion(completion_list_t *completions, wcstring comp, wcstring desc = wcstring(),
|
||||
int flags = 0,
|
||||
string_fuzzy_match_t &&match = string_fuzzy_match_t(fuzzy_match_exact));
|
||||
string_fuzzy_match_t match = string_fuzzy_match_t(fuzzy_match_exact));
|
||||
|
||||
/// Support for "wrap targets." A wrap target is a command that completes like another command.
|
||||
bool complete_add_wrapper(const wcstring &command, const wcstring &new_target);
|
||||
|
||||
@@ -402,7 +402,7 @@ static void update_fish_color_support(const environment_t &vars) {
|
||||
// Supporting versions of iTerm include a colon here.
|
||||
// We assume that if this is iTerm, it can't also be st, so having this check
|
||||
// inside is okay.
|
||||
if (it->as_string().find(L":") != wcstring::npos) {
|
||||
if (it->as_string().find(L':') != wcstring::npos) {
|
||||
FLOGF(term_support, L"Truecolor support: Enabling for ITERM");
|
||||
support_term24bit = true;
|
||||
}
|
||||
|
||||
@@ -444,9 +444,8 @@ std::string env_universal_t::serialize_with_vars(const var_table_t &vars) {
|
||||
contents.append("# VERSION: " UVARS_VERSION_3_0 "\n");
|
||||
|
||||
// Preserve legacy behavior by sorting the values first
|
||||
typedef std::pair<std::reference_wrapper<const wcstring>,
|
||||
std::reference_wrapper<const env_var_t>>
|
||||
env_pair_t;
|
||||
using env_pair_t =
|
||||
std::pair<std::reference_wrapper<const wcstring>, std::reference_wrapper<const env_var_t>>;
|
||||
std::vector<env_pair_t> cloned(vars.begin(), vars.end());
|
||||
std::sort(cloned.begin(), cloned.end(), [](const env_pair_t &p1, const env_pair_t &p2) {
|
||||
return p1.first.get() < p2.first.get();
|
||||
|
||||
@@ -1815,7 +1815,7 @@ static void test_escape_sequences() {
|
||||
class test_lru_t : public lru_cache_t<test_lru_t, int> {
|
||||
public:
|
||||
static constexpr size_t test_capacity = 16;
|
||||
typedef std::pair<wcstring, int> value_type;
|
||||
using value_type = std::pair<wcstring, int>;
|
||||
|
||||
test_lru_t() : lru_cache_t<test_lru_t, int>(test_capacity) {}
|
||||
|
||||
|
||||
@@ -1118,7 +1118,7 @@ static bool should_import_bash_history_line(const wcstring &line) {
|
||||
if (line.find(L"))") != std::string::npos) return false;
|
||||
// Skip lines with literal tabs since we don't handle them well and we don't know what they mean.
|
||||
// It could just be whitespace or it's actually passed somewhere (like e.g. `sed`).
|
||||
if (line.find(L"\t") != std::string::npos) return false;
|
||||
if (line.find(L'\t') != std::string::npos) return false;
|
||||
|
||||
// Skip lines that end with a backslash. We do not handle multiline commands from bash history.
|
||||
if (line.back() == L'\\') return false;
|
||||
|
||||
@@ -87,7 +87,7 @@ class parse_execution_context_t {
|
||||
enum process_type_t process_type_for_command(const ast::decorated_statement_t &statement,
|
||||
const wcstring &cmd) const;
|
||||
end_execution_reason_t apply_variable_assignments(
|
||||
process_t *proc, const ast::variable_assignment_list_t &variable_assignments,
|
||||
process_t *proc, const ast::variable_assignment_list_t &variable_assignment_list,
|
||||
const block_t **block);
|
||||
|
||||
// These create process_t structures from statements.
|
||||
|
||||
@@ -268,7 +268,7 @@ static bool wildcard_complete_internal(const wchar_t *const str, size_t str_len,
|
||||
// Note: out_completion may be empty if the completion really is empty, e.g. tab-completing
|
||||
// 'foo' when a file 'foo' exists.
|
||||
complete_flags_t local_flags = flags | (full_replacement ? COMPLETE_REPLACES_TOKEN : 0);
|
||||
append_completion(out, out_completion, out_desc, local_flags, std::move(match));
|
||||
append_completion(out, out_completion, out_desc, local_flags, match);
|
||||
return match_acceptable;
|
||||
} else if (next_wc_char_pos > 0) {
|
||||
// The literal portion of a wildcard cannot be longer than the string itself,
|
||||
|
||||
@@ -117,7 +117,7 @@ int wrename(const wcstring &oldName, const wcstring &newv);
|
||||
/// This does NOT retry on EINTR or EAGAIN, it simply returns.
|
||||
/// \return -1 on error in which case errno will have been set. In this event, the number of bytes
|
||||
/// actually written cannot be obtained.
|
||||
ssize_t wwrite_to_fd(const wchar_t *s, size_t len, int fd);
|
||||
ssize_t wwrite_to_fd(const wchar_t *input, size_t len, int fd);
|
||||
|
||||
/// Variant of above that accepts a wcstring.
|
||||
inline ssize_t wwrite_to_fd(const wcstring &s, int fd) {
|
||||
|
||||
Reference in New Issue
Block a user