The comma operator joins expressions outside a for head

tx0/ts:comma-sequencestrictwarningstyle

What it finds

The comma operator evaluates expressions one after another and keeps the last value, as in return a(), b;. It hides statements inside an expression, and is easily mistaken for a list of arguments or array elements.

The head of a for statement, where i++, j-- is the usual way to step two counters, is left alone, and so is (0, f)(), the idiom that calls a function without a this.

From the rule's source, comma_sequence.rs.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/ts:comma-sequence" = "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/ts:comma-sequence] reason="..."

tx0 explain tx0/ts:comma-sequence shows the same in the terminal. Found a false positive? Report it.