Two string literals in a list of strings are joined into one element, probably for want of a comma
What it finds
{ "red", "green" "blue", "white" }: adjacent string literals are joined into one, so a missing comma in a list of strings makes one element of two and the list one shorter than it looks.
The list must hold at least four strings and nothing else, exactly one of them written as two literals on separate lines, as the elements around it are. A string split on purpose usually shows it: the first part ends with a space, an escape such as \n or a separator such as /, the second starts with a space, or a comment follows the first part on its line. Such splits are left alone.
From the rule's source, string_list_missing_comma.rs.
Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/cpp:string-list-missing-comma" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/cpp:string-list-missing-comma] reason="..."tx0 explain tx0/cpp:string-list-missing-comma shows the same in the terminal. Found a false positive? Report it.