Skip to content

allman style brace formatting triggers suspicious_else_formatting #3864

Closed

Description

@wareya

.

Activity

  1. flip1995 commented on Mar 10, 2019

    @flip1995
    Member

    Example:

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

    Playground

  2. added
    C-bugCategory: Clippy is not doing the correct thing
    on Mar 10, 2019
  3. sdegutis commented on Jan 14, 2020

    @sdegutis

    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.

  4. flip1995 commented on Jan 16, 2020

    @flip1995
    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.

  5. added
    I-false-positiveIssue: The lint was triggered on code it shouldn't have
    on Dec 18, 2020
  6. added a commit that references this issue on Dec 19, 2020
  7. added a commit that references this issue on Apr 16, 2021
    831c157
  8. chilabot commented on Dec 4, 2024

    @chilabot

    I prefer to put linting in the Cargo.toml file, in the lints.clippy section. More accessible and visually better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't have

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions