Skip to content

Commit

Permalink
Switch to Cargo.toml based lint configuration (#189)
Browse files Browse the repository at this point in the history
As of the Cargo included in Rust 1.74, lints can now be configured in
`Cargo.toml` across whole crates/workspaces:
https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html
https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-lints-section

This reduces the boilerplate, and the chance that we forget to enable
lints in some targets.

Since this feature requires Rust 1.74, the MSRV has also been bumped
(however, libcnb 0.16.0 already requires Rust 1.74, so in practice
this is a no-op).

GUS-W-14523792.
  • Loading branch information
edmorley authored Nov 20, 2023
1 parent b98ed51 commit 651d765
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ version = "0.0.0"
description = "Heroku Go Cloud Native Buildpack"
edition = "2021"
publish = false
rust-version = "1.66"
rust-version = "1.74"

[lints.rust]
# TODO: Enable this lint once the lib target is split out to a shared code crate,
# which will reduce the false positives and make using this lint viable.
# unused_crate_dependencies = "warn"

[lints.clippy]
pedantic = "warn"

[dependencies]
flate2 = { version = "1", default-features = false, features = ["zlib"] }
Expand Down
2 changes: 0 additions & 2 deletions src/bin/diff_inventory.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![warn(clippy::pedantic)]

use heroku_go_buildpack::inv::{list_github_go_versions, Artifact, Inventory};
use std::collections::HashSet;

Expand Down
3 changes: 0 additions & 3 deletions src/bin/update_inventory.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]

use heroku_go_buildpack::inv::{list_github_go_versions, Artifact, Inventory};
use std::collections::HashSet;
use std::{env, fs, process};
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#![warn(clippy::pedantic)]
pub mod inv;
pub mod vrs;
3 changes: 0 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![warn(clippy::pedantic)]
#![warn(clippy::cargo)]

mod cfg;
mod cmd;
mod layers;
Expand Down
2 changes: 0 additions & 2 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![warn(clippy::pedantic)]

use libcnb_test::{assert_contains, assert_not_contains, BuildConfig, ContainerConfig, TestRunner};
use std::time::Duration;

Expand Down

0 comments on commit 651d765

Please sign in to comment.