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 Lint: stacked_ifs #12548

Closed

Conversation

ARandomDev99
Copy link
Contributor

Closes #12483

changelog: new lint: [`stacked_ifs`]

@rustbot
Copy link
Collaborator

rustbot commented Mar 24, 2024

r? @Alexendoo

rustbot has assigned @Alexendoo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 24, 2024
tests/ui/stacked_ifs.rs Show resolved Hide resolved
clippy_lints/src/stacked_ifs.rs Outdated Show resolved Hide resolved
clippy_lints/src/stacked_ifs.rs Outdated Show resolved Hide resolved
clippy_lints/src/stacked_ifs.rs Outdated Show resolved Hide resolved
@ARandomDev99
Copy link
Contributor Author

ARandomDev99 commented Mar 25, 2024

I have also modified the code for the Binary expression part to now check for if statements in both the left-hand side and right-hand side and added an additional test accordingly.

clippy_lints/src/stacked_ifs.rs Outdated Show resolved Hide resolved
clippy_lints/src/stacked_ifs.rs Outdated Show resolved Hide resolved
tests/ui/stacked_ifs.rs Outdated Show resolved Hide resolved
This commit:
- Adds a new late pass lint
- Adds relevant UI tests
@Alexendoo
Copy link
Member

@Alexendoo Alexendoo added S-final-comment-period Status: final comment period it will be merged unless new objections are raised (~1 week) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Mar 30, 2024
@ARandomDev99
Copy link
Contributor Author

ARandomDev99 commented May 2, 2024

I'll open a new PR incorporating the changes from https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/FCP.20.60stacked_ifs.60

@ARandomDev99 ARandomDev99 deleted the stacked-ifs-12483 branch May 2, 2024 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-final-comment-period Status: final comment period it will be merged unless new objections are raised (~1 week)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ban Stacked if's
3 participants