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

[Adjust Rule] loosen SIM115 when just opening a file without reference #174

Open
jamesbraza opened this issue Apr 14, 2023 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@jamesbraza
Copy link

Desired change

  • Rule(s): SIM115
  • Adjustment: should not be triggered when not referencing the return

Explanation

Why is the adjustment necessary / better?

When not referencing the return of open, context management isn't necessary.

Example

This is an example where the mentioned rule(s) would currently be suboptimal:

# Not referencing the return, simply just creating an empty file
open(path, mode="w")
@jamesbraza jamesbraza added the enhancement New feature or request label Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants