Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: linter rule for unused variables, generally #26172

Open
jabraham17 opened this issue Oct 30, 2024 · 0 comments
Open

[Feature Request]: linter rule for unused variables, generally #26172

jabraham17 opened this issue Oct 30, 2024 · 0 comments
Labels
area: Python bindings For things related to chapel-py, chpl-language-server, chplcheck, etc. area: Tools type: Feature Request

Comments

@jabraham17
Copy link
Member

We currently have several different "Unused*" rules in chplcheck.

  • UnusedFormal
  • UnusedLoopIndex
  • UnusedTupleUnpack
  • UnusedTaskIntent
  • UnusedTypeQuery

All of these rules have very similar logic to compute them, and could probably be refactored to a common rule. Even if we want to keep them as separate rules (although I don't know that there's much utility to that), they can at least share common code.

From that mindset, these all have the same theme: "unused var-like thing". However, we don't have a lint rule for just variables, and I think this should be added.

We could also consider UnusedFunction and UnusedType (records, classes, enums, etc), although this may be more annoying than anything else. Especially as we start to consider Chapel libraries, the place where the function is used may not be available. One limited possibly here is to only check for UnusedFunction/UnusedType inside a limited scope like a function body.

@jabraham17 jabraham17 added type: Feature Request area: Tools area: Python bindings For things related to chapel-py, chpl-language-server, chplcheck, etc. labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Python bindings For things related to chapel-py, chpl-language-server, chplcheck, etc. area: Tools type: Feature Request
Projects
None yet
Development

No branches or pull requests

1 participant