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

SIM108 suggested for code block that could have been simplified to an or #12189

Closed
brettcannon opened this issue Jul 4, 2024 · 1 comment · Fixed by #12796
Closed

SIM108 suggested for code block that could have been simplified to an or #12189

brettcannon opened this issue Jul 4, 2024 · 1 comment · Fixed by #12796
Labels
accepted Ready for implementation rule Implementing or modifying a lint rule

Comments

@brettcannon
Copy link
Contributor

  • List of keywords you searched for before creating this issue: SIM108
  • A minimal code snippet that reproduces the bug.
if raw_data["subtest"]:
        test_id = raw_data["subtest"]
    else:
        test_id = raw_data["test"]
  • The command you invoked: pipx run ruff check --fix --select SIM unittestadapter/execution.py
  • The current Ruff version: 0.5.0

I would have expected the code block to be simplified to test_id = raw_data["subtest"] or raw_data["test"].

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Jul 4, 2024
@charliermarsh
Copy link
Member

Makes sense, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation rule Implementing or modifying a lint rule
Projects
None yet
2 participants