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)
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
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