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

[New Rule] Duplicate blocks in if/else #192

Open
sanxiyn opened this issue Feb 2, 2024 · 0 comments
Open

[New Rule] Duplicate blocks in if/else #192

sanxiyn opened this issue Feb 2, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@sanxiyn
Copy link

sanxiyn commented Feb 2, 2024

Explanation

Inspired by if_same_then_else rule in Rust Clippy. See https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else. SIM114(#10) is similar, but it only checks if/elif, not if/else.

Example

# Bad
if a:
    b
else:
    b

# Good
b
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