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

allman style brace formatting triggers suspicious_else_formatting #3864

Closed
wareya opened this issue Mar 10, 2019 · 3 comments · Fixed by #7087
Closed

allman style brace formatting triggers suspicious_else_formatting #3864

wareya opened this issue Mar 10, 2019 · 3 comments · Fixed by #7087
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have

Comments

@wareya
Copy link

wareya commented Mar 10, 2019

.

@flip1995
Copy link
Member

Example:

fn main() {
    if true 
    {
        println!("Hi");
    }
    else 
    {
        println!("Bye");
    }
}

Playground

@flip1995 flip1995 added the C-bug Category: Clippy is not doing the correct thing label Mar 10, 2019
@thesoftwarephilosopher
Copy link

I just switched to this style and now all my else-statements are being triggered. Is there at least a way to tell clippy to silence this warning for the whole project? I can't find what to put inside .clippy.toml to silence this, if any such thing exists.

@flip1995
Copy link
Member

clippy.toml doesn't and won't support allowing/denying lints. You can do this in the main.rs/lib.rs file with #![allow(clippy::suspicious_else_formatting)] at the top of the file.

@phansch phansch added the I-false-positive Issue: The lint was triggered on code it shouldn't have label Dec 18, 2020
bors added a commit that referenced this issue Dec 19, 2020
UI Tests: Separate suspicious_else_formatting tests

Was briefly looking into #3864 when I saw that the tests could benefit from being in their own file.

---
changelog: none
@bors bors closed this as completed in 831c157 Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-positive Issue: The lint was triggered on code it shouldn't have
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants