diff --git a/.clang-tidy b/.clang-tidy index fd47b8fc5..0904397f2 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: 'clang-diagnostic-*,clang-analyzer-*,cert-*,performance-*,portability-*,modernize-use-auto,modernize-loop-convert,modernize-use-bool-literals,modernize-use-using,hicpp-uppercase-literal-suffix,readability-make-member-function-const' +Checks: 'clang-diagnostic-*,clang-analyzer-*,cert-*,performance-*,portability-*,modernize-use-auto,modernize-loop-convert,modernize-use-bool-literals,modernize-use-using,hicpp-uppercase-literal-suffix,readability-make-member-function-const,readability-redundant-string-init,readability-inconsistent-declaration-parameter-name' WarningsAsErrors: '' HeaderFilterRegex: '' AnalyzeTemporaryDtors: false diff --git a/src/builtin_argparse.cpp b/src/builtin_argparse.cpp index ca1ad096f..c4a4dd353 100644 --- a/src/builtin_argparse.cpp +++ b/src/builtin_argparse.cpp @@ -51,7 +51,7 @@ struct argparse_cmd_opts_t { size_t min_args = 0; size_t max_args = SIZE_MAX; wchar_t implicit_int_flag = L'\0'; - wcstring name = L""; + wcstring name; wcstring_list_t raw_exclusive_flags; wcstring_list_t argv; std::unordered_map options; diff --git a/src/builtin_function.cpp b/src/builtin_function.cpp index 31a22ce25..ab10aeff7 100644 --- a/src/builtin_function.cpp +++ b/src/builtin_function.cpp @@ -29,7 +29,7 @@ struct function_cmd_opts_t { bool print_help = false; bool shadow_scope = true; - wcstring description = L""; + wcstring description; std::vector events; wcstring_list_t named_arguments; wcstring_list_t inherit_vars; diff --git a/src/builtin_function.h b/src/builtin_function.h index be69f8485..9499a9a9f 100644 --- a/src/builtin_function.h +++ b/src/builtin_function.h @@ -9,5 +9,6 @@ class parser_t; struct io_streams_t; int builtin_function(parser_t &parser, io_streams_t &streams, const wcstring_list_t &c_args, - const parsed_source_ref_t &source, tnode_t body); + const parsed_source_ref_t &source, + tnode_t func_node); #endif diff --git a/src/expand.h b/src/expand.h index 423b0559c..0e09b61e6 100644 --- a/src/expand.h +++ b/src/expand.h @@ -189,7 +189,7 @@ wcstring expand_escape_variable(const env_var_t &var); /// Convert a string value to a human readable form, i.e. escape things, handle arrays, etc. /// Suitable for pretty-printing. -wcstring expand_escape_string(const wcstring &str); +wcstring expand_escape_string(const wcstring &el); /// Perform tilde expansion and nothing else on the specified string, which is modified in place. /// diff --git a/src/parse_execution.cpp b/src/parse_execution.cpp index 978f898fb..fc1335c5d 100644 --- a/src/parse_execution.cpp +++ b/src/parse_execution.cpp @@ -485,7 +485,7 @@ end_execution_reason_t parse_execution_context_t::run_switch_statement( // If we expanded to nothing, match the empty string. assert(switch_values_expanded.size() <= 1 && "Should have at most one expansion"); - wcstring switch_value_expanded = L""; + wcstring switch_value_expanded; if (!switch_values_expanded.empty()) { switch_value_expanded = std::move(switch_values_expanded.front().completion); }