[Chapel Merge] chplcheck: warn for unused pattern matching like `(_, _)`

Branch: refs/heads/main
Revision: c13483cdef594ac17b834e0c7fa36ba700d39e54
Author: DanilaFe
Link: chplcheck: warn for unused pattern matching like `(_, _)` by DanilaFe · Pull Request #24859 · chapel-lang/chapel · GitHub
Log Message:
chplcheck: warn for unused pattern matching like (_, _) (#24859)

Fixes [Feature Request]: improve UnusedLoopIndex chplcheck warning · Issue #24838 · chapel-lang/chapel · GitHub.

I believe it's better to warn about unused pattern matching separately
from unused loop indices (one might avoid one but not the other), so
this PR adds a new rule. This rule has an auto-fixit so you can turn
unused (_, _) into _ automatically.

Reviewed by @jabraham17 -- thanks!

Testing

  • dyno tests
  • test/chplcheck

Compare: Comparing b35a6b00fc1fbfc090376fbfc26160348b00673b...acd2f40b7fddc5e703b6ea01b0e06d311dafe24b · chapel-lang/chapel · GitHub

Diff:
A test/chplcheck/UnusedTupleUnpack.chpl
A test/chplcheck/UnusedTupleUnpack.good
A test/chplcheck/UnusedTupleUnpack.good-fixit
M test/chplcheck/activerules.good
M test/chplcheck/allrules.good
M tools/chplcheck/src/chplcheck.py
M tools/chplcheck/src/rules.py
https://github.com/chapel-lang/chapel/pull/24859.diff