Skip to content

Commit

Permalink
Migrate to the Linebender Lint set v5 (#805)
Browse files Browse the repository at this point in the history
This cuts prunes down the number of lints checked in CI, with the aim of
improving velocity.
  • Loading branch information
DJMcNab authored Jan 31, 2025
1 parent 05b7d69 commit f0b040d
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 57 deletions.
16 changes: 1 addition & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,59 +33,45 @@ repository = "https://github.com/linebender/vello"

[workspace.lints]

# LINEBENDER LINT SET - Cargo.toml - v3
# LINEBENDER LINT SET - Cargo.toml - v5
# See https://linebender.org/wiki/canonical-lints/
rust.keyword_idents_2024 = "forbid"
rust.non_ascii_idents = "forbid"
rust.non_local_definitions = "forbid"
rust.unsafe_op_in_unsafe_fn = "forbid"

rust.elided_lifetimes_in_paths = "warn"
rust.let_underscore_drop = "warn"
rust.missing_debug_implementations = "warn"
rust.missing_docs = "warn"
rust.single_use_lifetimes = "warn"
rust.trivial_numeric_casts = "warn"
rust.unexpected_cfgs = "warn"
rust.unit_bindings = "warn"
rust.unnameable_types = "warn"
rust.unreachable_pub = "warn"
rust.unused_import_braces = "warn"
rust.unused_lifetimes = "warn"
rust.unused_macro_rules = "warn"
rust.unused_qualifications = "warn"
rust.variant_size_differences = "warn"

clippy.too_many_arguments = "allow"

clippy.allow_attributes = "warn"
clippy.allow_attributes_without_reason = "warn"
clippy.cast_possible_truncation = "warn"
clippy.collection_is_never_read = "warn"
clippy.dbg_macro = "warn"
clippy.debug_assert_with_mut_call = "warn"
clippy.doc_markdown = "warn"
clippy.exhaustive_enums = "warn"
clippy.fn_to_numeric_cast_any = "warn"
clippy.infinite_loop = "warn"
clippy.large_include_file = "warn"
clippy.large_stack_arrays = "warn"
clippy.match_same_arms = "warn"
clippy.mismatching_type_param_order = "warn"
clippy.missing_assert_message = "warn"
clippy.missing_errors_doc = "warn"
clippy.missing_fields_in_debug = "warn"
clippy.missing_panics_doc = "warn"
clippy.partial_pub_fields = "warn"
clippy.return_self_not_must_use = "warn"
clippy.same_functions_in_if_condition = "warn"
clippy.semicolon_if_nothing_returned = "warn"
clippy.shadow_unrelated = "warn"
clippy.should_panic_without_expect = "warn"
clippy.todo = "warn"
clippy.unseparated_literal_suffix = "warn"
clippy.use_self = "warn"
clippy.wildcard_imports = "warn"

clippy.cargo_common_metadata = "warn"
clippy.negative_feature_names = "warn"
Expand Down
9 changes: 1 addition & 8 deletions examples/scenes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,11 @@
// Feel free to send a PR that solves one or more of these.
#![allow(
missing_debug_implementations,
single_use_lifetimes,
unreachable_pub,
missing_docs,
clippy::wildcard_imports,
clippy::cast_possible_truncation,
clippy::shadow_unrelated,
clippy::missing_panics_doc,
clippy::missing_errors_doc,
clippy::partial_pub_fields,
clippy::match_same_arms,
clippy::allow_attributes_without_reason,
clippy::allow_attributes
clippy::allow_attributes_without_reason
)]

mod images;
Expand Down
5 changes: 1 addition & 4 deletions examples/with_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@
#![allow(
unreachable_pub,
clippy::allow_attributes_without_reason,
clippy::allow_attributes,
clippy::cast_possible_truncation,
clippy::shadow_unrelated,
clippy::missing_errors_doc,
clippy::missing_panics_doc
clippy::shadow_unrelated
)]

use std::collections::HashSet;
Expand Down
6 changes: 0 additions & 6 deletions vello/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,16 @@
#![allow(missing_docs, reason = "We have many as-yet undocumented items.")]
#![expect(
missing_debug_implementations,
single_use_lifetimes,
unnameable_types,
unreachable_pub,
clippy::cast_possible_truncation,
clippy::missing_assert_message,
clippy::shadow_unrelated,
clippy::missing_panics_doc,
clippy::exhaustive_enums,
clippy::print_stderr,
clippy::match_same_arms,
reason = "Deferred"
)]
#![allow(
clippy::missing_errors_doc,
clippy::todo,
clippy::partial_pub_fields,
reason = "Deferred, only apply in some feature sets so not expect"
)]

Expand Down
5 changes: 0 additions & 5 deletions vello_encoding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,13 @@
#![allow(missing_docs, reason = "We have many as-yet undocumented items.")]
#![expect(
missing_debug_implementations,
single_use_lifetimes,
clippy::cast_possible_truncation,
clippy::missing_assert_message,
clippy::missing_panics_doc,
reason = "Deferred"
)]
#![allow(
unnameable_types,
clippy::shadow_unrelated,
// Only applies on WASM?
variant_size_differences,
clippy::exhaustive_enums,
reason = "Deferred, only apply in some feature sets so not expect"
)]

Expand Down
8 changes: 0 additions & 8 deletions vello_shaders/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ fn write_shaders(
shaders: &[(String, ShaderInfo)],
) -> Result<(), std::fmt::Error> {
writeln!(buf, "mod generated {{")?;
writeln!(
buf,
" #![expect(clippy::allow_attributes, reason=\"Expect doesn't work with wildcard_imports\")]"
)?;
writeln!(
buf,
" #[allow(clippy::wildcard_imports, reason=\"Allows using Debug for codegen\")]"
)?;
writeln!(buf, " use super::*;")?;
writeln!(buf, " use BindType::*;")?;
writeln!(buf, " pub const SHADERS: Shaders<'static> = Shaders {{")?;
Expand Down
9 changes: 1 addition & 8 deletions vello_shaders/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,11 @@
// Feel free to send a PR that solves one or more of these.
// Need to allow instead of expect until Rust 1.83 https://github.com/rust-lang/rust/pull/130025
#![allow(missing_docs, reason = "We have many as-yet undocumented items.")]
#![expect(
missing_debug_implementations,
clippy::exhaustive_enums,
reason = "Deferred"
)]
#![expect(missing_debug_implementations, reason = "Deferred")]
#![allow(
single_use_lifetimes,
unnameable_types,
clippy::cast_possible_truncation,
clippy::missing_assert_message,
clippy::missing_errors_doc,
clippy::missing_panics_doc,
clippy::print_stderr,
clippy::print_stdout,
clippy::shadow_unrelated,
Expand Down
3 changes: 0 additions & 3 deletions vello_tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
missing_docs,
clippy::missing_assert_message,
clippy::shadow_unrelated,
clippy::missing_panics_doc,
clippy::missing_errors_doc,
clippy::exhaustive_enums,
clippy::print_stderr,
clippy::print_stdout,
clippy::allow_attributes_without_reason
Expand Down

0 comments on commit f0b040d

Please sign in to comment.