Skip to content

Instantly share code, notes, and snippets.

@tombh
Last active February 16, 2025 19:40
Show Gist options
  • Save tombh/d888f54328e4fbed7e84d72d5bd6f5f6 to your computer and use it in GitHub Desktop.
Save tombh/d888f54328e4fbed7e84d72d5bd6f5f6 to your computer and use it in GitHub Desktop.

Revisions

  1. tombh revised this gist Feb 16, 2025. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion loud_cargo.toml
    Original file line number Diff line number Diff line change
    @@ -34,4 +34,7 @@ cargo = { level = "warn", priority = -1 }
    # > this lint triggers on. However, those lints are really strict by design and you might want
    # > to #[allow] them in some special cases, with a comment justifying that.
    restriction = { level = "warn", priority = -1 }
    blanket_clippy_restriction_lints = "allow"
    blanket_clippy_restriction_lints = "allow"

    # Individually blanket-allow single lints relevant to this whole crate
    #arithmetic_side_effects = "allow"
  2. tombh created this gist Feb 16, 2025.
    37 changes: 37 additions & 0 deletions loud_cargo.toml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    # Canonical lints for whole crate
    #
    # Official docs:
    # https://doc.rust-lang.org/nightly/clippy/lints.html
    # Useful app to lookup full details of individual lints:
    # https://rust-lang.github.io/rust-clippy/master/index.html
    #
    # We set base lints to give the fullest, most pedantic feedback possible.
    # Though we prefer that they are just warnings during development so that build-denial
    # is only enforced in CI.
    [lints.rust]
    # It's always good to write as much documentation as possible
    missing_docs = "warn"

    [lints.clippy]
    # `clippy::all` is already on by default. It implies the following:
    # * clippy::correctness code that is outright wrong or useless
    # * clippy::suspicious code that is most likely wrong or useless
    # * clippy::complexity code that does something simple but in a complex way
    # * clippy::perf code that can be written to run faster
    # * clippy::style code that should be written in a more idiomatic way
    all = { level = "warn", priority = -1 }
    # > clippy::pedantic lints which are rather strict or might have false positives
    pedantic = { level = "warn", priority = -1 }
    # > new lints that are still under development
    # (so "nursery" doesn't mean "Rust newbies")
    nursery = { level = "warn", priority = -1 }
    # > The clippy::cargo group gives you suggestions on how to improve your Cargo.toml file.
    # > This might be especially interesting if you want to publish your crate and are not sure
    # > if you have all useful information in your Cargo.toml.
    cargo = { level = "warn", priority = -1 }
    # > The clippy::restriction group will restrict you in some way.
    # > If you enable a restriction lint for your crate it is recommended to also fix code that
    # > this lint triggers on. However, those lints are really strict by design and you might want
    # > to #[allow] them in some special cases, with a comment justifying that.
    restriction = { level = "warn", priority = -1 }
    blanket_clippy_restriction_lints = "allow"