Tell clang-tidy that expander_t::stage_variables intentionally takes values

We don't want to convert the input to a "wcstring &" because
"stage_variables" needs to have the same type as other stages, so we
can use it in a loop. Communicate that to clang-tidy.

We also don't want to take "wcstring &&". As the Google style guide
states, it's not really beneficial here, and it potentially hurts
readability because it's a relatively obscure feature.
The rest of our code contains a bunch of && parameters.  We might
want to get rid of some of them.

Closes #8227
This commit is contained in:
Johannes Altmanninger 2021-08-20 00:47:51 +02:00
parent ffa3e0b4f4
commit 5de05a810c

View file

@ -1002,6 +1002,7 @@ expand_result_t expander_t::stage_cmdsubst(wcstring input, completion_receiver_t
}
}
// We pass by value to match other stages. NOLINTNEXTLINE(performance-unnecessary-value-param)
expand_result_t expander_t::stage_variables(wcstring input, completion_receiver_t *out) {
// We accept incomplete strings here, since complete uses expand_string to expand incomplete
// strings from the commandline.