You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WPS515 is that you can't use open() outside of a context manager (with open() as x:), but it does not detect an optional context manager, specifically when a file is being opened only as a condition (with (open() if check else nullcontext()) as x:)
How it should be
It should detect the optional open in a context manager as valid (with (open() if check else nullcontext()) as x:)
What's wrong
WPS515 is that you can't use
open()
outside of a context manager (with open() as x:
), but it does not detect an optional context manager, specifically when a file is being opened only as a condition (with (open() if check else nullcontext()) as x:
)How it should be
It should detect the optional open in a context manager as valid (
with (open() if check else nullcontext()) as x:
)Flake8 version and plugins
contents of
flake8 --bug-report
is this:contents of flake8 config on pre-commit where this was run:
pip information
pip version:
pip 22.3.1
poetry version:
Poetry version 1.1.14
pip freeze output:
OS information
Ubuntu 18.04
The text was updated successfully, but these errors were encountered: