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

Add option to prevent all kinds of top-level variable re-assignments #18

Open
leonklingele opened this issue Aug 1, 2023 · 1 comment

Comments

@leonklingele
Copy link

Currently, only re-assignments to top-level variables of another package are detected. It would be nice to also prevent re-assigning any top-level variable so they are read-only.

@chokoswitch
Copy link
Collaborator

chokoswitch commented Aug 2, 2023

Thanks @leonklingele - this option was originally left out because it can lead to more false positives than overriding imports and that actually the code for handling it would look very different, not using the import mechanism. There are some things to think about, for example presumably the assignment should be allowed within an init() function as it's a common pattern.

As an explicit opt-in pattern though, it may still be useful, will look into how it could be added to the linting code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants