Skip to content

Commit 3e17dd0

Browse files
authored
Update to Linebender lint set v2. (#33)
Solved [`cargo_common_metadata`](https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata), deferred others.
1 parent 399922b commit 3e17dd0

File tree

3 files changed

+47
-10
lines changed

3 files changed

+47
-10
lines changed

.clippy.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# LINEBENDER LINT SET - .clippy.toml - v1
2+
# See https://linebender.org/wiki/canonical-lints/
3+
4+
# The default Clippy value is capped at 8 bytes, which was chosen to improve performance on 32-bit.
5+
# Given that we are building for the future and even low-end mobile phones have 64-bit CPUs,
6+
# it makes sense to optimize for 64-bit and accept the performance hits on 32-bit.
7+
# 16 bytes is the number of bytes that fits into two 64-bit CPU registers.
8+
trivial-copy-size-limit = 16
9+
10+
# END LINEBENDER LINT SET

Cargo.toml

+16-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "interpoli"
33
version = "0.1.0"
44
license = "Apache-2.0 OR MIT"
55
edition = "2021"
6-
description = ""
6+
description = "A library for animating values."
77
keywords = ["graphics", "animation"]
88
categories = ["graphics"]
99
repository = "https://github.com/linebender/interpoli"
@@ -35,13 +35,18 @@ vello = { version = "0.2.0", default-features = false, optional = true }
3535
[lints]
3636
rust.unsafe_code = "forbid"
3737

38+
# LINEBENDER LINT SET - Cargo.toml - v2
39+
# See https://linebender.org/wiki/canonical-lints/
3840
rust.keyword_idents_2024 = "forbid"
3941
rust.non_ascii_idents = "forbid"
4042
rust.non_local_definitions = "forbid"
4143
rust.unsafe_op_in_unsafe_fn = "forbid"
4244

45+
rust.elided_lifetimes_in_paths = "warn"
4346
rust.let_underscore_drop = "warn"
4447
rust.missing_debug_implementations = "warn"
48+
rust.missing_docs = "warn"
49+
rust.single_use_lifetimes = "warn"
4550
rust.trivial_numeric_casts = "warn"
4651
rust.unexpected_cfgs = "warn"
4752
rust.unit_bindings = "warn"
@@ -53,11 +58,14 @@ rust.unused_macro_rules = "warn"
5358
rust.unused_qualifications = "warn"
5459
rust.variant_size_differences = "warn"
5560

61+
clippy.allow_attributes = "warn"
5662
clippy.allow_attributes_without_reason = "warn"
63+
clippy.cast_possible_truncation = "warn"
5764
clippy.collection_is_never_read = "warn"
5865
clippy.dbg_macro = "warn"
5966
clippy.debug_assert_with_mut_call = "warn"
6067
clippy.doc_markdown = "warn"
68+
clippy.exhaustive_enums = "warn"
6169
clippy.fn_to_numeric_cast_any = "forbid"
6270
clippy.infinite_loop = "warn"
6371
clippy.large_include_file = "warn"
@@ -75,11 +83,13 @@ clippy.semicolon_if_nothing_returned = "warn"
7583
clippy.shadow_unrelated = "warn"
7684
clippy.should_panic_without_expect = "warn"
7785
clippy.todo = "warn"
86+
clippy.trivially_copy_pass_by_ref = "warn"
7887
clippy.unseparated_literal_suffix = "warn"
88+
clippy.use_self = "warn"
7989
clippy.wildcard_imports = "warn"
8090

81-
# TODO: Enable these and move them back above.
82-
# clippy.use_self = "warn"
83-
# rust.elided_lifetimes_in_paths = "warn"
84-
# rust.missing_docs = "warn"
85-
# rust.single_use_lifetimes = "warn"
91+
clippy.cargo_common_metadata = "warn"
92+
clippy.negative_feature_names = "warn"
93+
clippy.redundant_feature_names = "warn"
94+
clippy.wildcard_dependencies = "warn"
95+
# END LINEBENDER LINT SET

src/lib.rs

+21-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
// Copyright 2024 the Interpoli Authors
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

4-
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
5-
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
6-
#![warn(unused_crate_dependencies)]
7-
84
//! # Interpoli
95
6+
// LINEBENDER LINT SET - lib.rs - v1
7+
// See https://linebender.org/wiki/canonical-lints/
8+
// These lints aren't included in Cargo.toml because they
9+
// shouldn't apply to examples and tests
10+
#![warn(unused_crate_dependencies)]
11+
#![warn(clippy::print_stdout, clippy::print_stderr)]
12+
// END LINEBENDER LINT SET
13+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
14+
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
15+
// The following lints are part of the Linebender standard set,
16+
// but resolving them has been deferred for now.
17+
// Feel free to send a PR that solves one or more of these.
18+
#![allow(
19+
missing_docs,
20+
single_use_lifetimes,
21+
elided_lifetimes_in_paths,
22+
clippy::use_self,
23+
clippy::cast_possible_truncation,
24+
clippy::exhaustive_enums
25+
)]
26+
1027
extern crate alloc;
1128

1229
use kurbo::Affine;

0 commit comments

Comments
 (0)