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]: lint rule that warns about unqualified imports #26102

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

[Feature Request]: lint rule that warns about unqualified imports #26102

jabraham17 opened this issue Oct 16, 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

jabraham17 commented Oct 16, 2024

Given the possibility that a module could add a new symbol and break code, it would be nice if chplcheck could help users avoid this situation

For example

// in A.chpl
module A {
  proc bar() { }
}

// in Main.chpl
module Main {
  public use A;
  proc foo() { }
  proc main() {
    foo();
    bar();
  }
}

Should someone add a proc foo to A, this code will break. However, a linter rule for unqualified import could se use A and warn, suggesting import A.

Regardless of the code breaking argument, users may just generally prefer only using qualified access and this lint rule can help them enforce that.

Note that I strongly feel that this should be an off-by-default lint warning that users can opt into if they wish.

@jabraham17 jabraham17 added type: Feature Request area: Tools area: Python bindings For things related to chapel-py, chpl-language-server, chplcheck, etc. labels Oct 16, 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