Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply the standard Linebender lint set #56

Merged
merged 4 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ features = ["alloc"]
[lints]
rust.unsafe_code = "forbid"

# LINEBENDER LINT SET - v1
PoignardAzur marked this conversation as resolved.
Show resolved Hide resolved
# See https://linebender.org/wiki/canonical-lints/
rust.keyword_idents_2024 = "forbid"
rust.non_ascii_idents = "forbid"
rust.non_local_definitions = "forbid"
Expand All @@ -64,11 +66,14 @@ rust.unused_macro_rules = "warn"
rust.unused_qualifications = "warn"
rust.variant_size_differences = "warn"

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 = "forbid"
clippy.infinite_loop = "warn"
clippy.large_include_file = "warn"
Expand All @@ -90,22 +95,8 @@ clippy.unseparated_literal_suffix = "warn"
clippy.use_self = "warn"
clippy.wildcard_imports = "warn"

# This catches duplicated dependencies in the tree, which we don't have much control over
# We should use cargo deny for this, anyway
clippy.cargo = { level = "warn", priority = -1 }

# Lints which we set in `lib.rs`, instead of at a package level.

# False positives with example targets - https://github.com/rust-lang/rust/issues/57274
# rust.unused_crate_dependencies = "warn"
# Examples often do want to print
# clippy.print_stdout = "warn"
# clippy.print_stderr = "warn"

## Explicit per-crate exceptions, should be manually checked occasionally.
# There are lots of conversion to u8 color field, which in degenerate cases might not work
# properly, but generally are fine.
# E.g. `multiply_alpha` sets the alpha to `0` for a negative provided `alpha`
PoignardAzur marked this conversation as resolved.
Show resolved Hide resolved
# clippy.cast_possible_truncation = "warn"
# Most enums are correctly exhaustive, as this is a vocabulary crate.
# clippy.exhaustive_enums = "warn"
clippy.cargo_common_metadata = "warn"
clippy.negative_feature_names = "warn"
clippy.redundant_feature_names = "warn"
clippy.wildcard_dependencies = "warn"
# END LINEBENDER LINT SET
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@

#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
#![warn(unused_crate_dependencies)]
#![warn(clippy::print_stdout, clippy::print_stderr)]
// There are lots of conversion to u8 color field, which in degenerate cases might not work
// properly, but generally are fine.
// E.g. `multiply_alpha` sets the alpha to `0` for a negative provided `alpha`.
#![allow(clippy::cast_possible_truncation)]
// Most enums are correctly exhaustive, as this is a vocabulary crate.
#![allow(clippy::exhaustive_enums)]

mod blend;
mod blob;
Expand Down