Skip to content

Commit 5ca9717

Browse files
committed
Import the full Linebender lint set
1 parent b2a3c95 commit 5ca9717

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

Cargo.toml

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[workspace]
22
resolver = "2"
3-
members = [
4-
"color",
5-
"color_operations",
6-
]
3+
members = ["color", "color_operations"]
74

85
[workspace.package]
96
# Color version, also used by other packages which want to mimic Color's version.
@@ -23,6 +20,8 @@ repository = "https://github.com/linebender/color"
2320
[workspace.lints]
2421
rust.unsafe_code = "forbid"
2522

23+
# LINEBENDER LINT SET - v1
24+
# See https://linebender.org/wiki/canonical-lints/
2625
rust.keyword_idents_2024 = "forbid"
2726
rust.non_ascii_idents = "forbid"
2827
rust.non_local_definitions = "forbid"
@@ -44,11 +43,14 @@ rust.unused_macro_rules = "warn"
4443
rust.unused_qualifications = "warn"
4544
rust.variant_size_differences = "warn"
4645

46+
clippy.allow_attributes = "warn"
4747
clippy.allow_attributes_without_reason = "warn"
48+
clippy.cast_possible_truncation = "warn"
4849
clippy.collection_is_never_read = "warn"
4950
clippy.dbg_macro = "warn"
5051
clippy.debug_assert_with_mut_call = "warn"
5152
clippy.doc_markdown = "warn"
53+
clippy.exhaustive_enums = "warn"
5254
clippy.fn_to_numeric_cast_any = "forbid"
5355
clippy.infinite_loop = "warn"
5456
clippy.large_include_file = "warn"
@@ -70,6 +72,12 @@ clippy.unseparated_literal_suffix = "warn"
7072
clippy.use_self = "warn"
7173
clippy.wildcard_imports = "warn"
7274

75+
clippy.cargo_common_metadata = "warn"
76+
clippy.negative_feature_names = "warn"
77+
clippy.redundant_feature_names = "warn"
78+
clippy.wildcard_dependencies = "warn"
79+
# END LINEBENDER LINT SET
80+
7381
[workspace.dependencies]
7482
color = { version = "0.1.0", path = "color", default-features = false }
7583
color_operations = { version = "0.1.0", path = "color_operations" }

color/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ categories = ["graphics"]
99
repository.workspace = true
1010
rust-version.workspace = true
1111

12+
# Whilst we prepare the initial release
13+
publish = false
14+
1215
[features]
1316
default = ["std"]
1417
std = []

color/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

44
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
5+
// LINEBENDER LINT SET - v1
6+
// See https://linebender.org/wiki/canonical-lints/
7+
// These lints aren't included in Cargo.toml because they
8+
// shouldn't apply to examples and tests
59
#![warn(unused_crate_dependencies)]
10+
#![warn(clippy::print_stdout, clippy::print_stderr)]
611

712
//! # Color

color_operations/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ categories = []
99
repository.workspace = true
1010
rust-version.workspace = true
1111

12+
# Whilst we prepare the initial release
13+
publish = false
14+
1215
[features]
1316
default = ["std"]
1417
std = []

color_operations/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

44
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
5+
// LINEBENDER LINT SET - v1
6+
// See https://linebender.org/wiki/canonical-lints/
7+
// These lints aren't included in Cargo.toml because they
8+
// shouldn't apply to examples and tests
59
#![warn(unused_crate_dependencies)]
10+
#![warn(clippy::print_stdout, clippy::print_stderr)]
611

712
//! # Color Operations
813

0 commit comments

Comments
 (0)