Skip to content

Commit

Permalink
Uncomment all the correct lints
Browse files Browse the repository at this point in the history
  • Loading branch information
DJMcNab committed Aug 5, 2024
1 parent c18f168 commit 10b0f7a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This release has an [MSRV] of 1.74.

### Changed

...
- Breaking: Mark `Format` as `#[non_exhaustive]` ([#XXX][] by [@DJMcNab][])

### Fixed

Expand Down
38 changes: 21 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,34 +78,38 @@ rust.missing_debug_implementations = "warn"
rust.unused_qualifications = "warn"
rust.single_use_lifetimes = "warn"

# clippy.exhaustive_enums = "warn"
# clippy.dbg_macro = "warn"
# clippy.match_same_arms = "warn"
clippy.dbg_macro = "warn"
clippy.match_same_arms = "warn"
# clippy.cast_possible_truncation = "warn"
# clippy.missing_assert_message = "warn"
# clippy.return_self_not_must_use = "warn"
# clippy.wildcard_imports = "warn"
# rust.elided_lifetimes_in_paths = "warn"
clippy.missing_assert_message = "warn"
clippy.return_self_not_must_use = "warn"
clippy.wildcard_imports = "warn"
rust.elided_lifetimes_in_paths = "warn"
# clippy.use_self = "warn"

# Aspirational lints, not enabled for one reason or another

rust.missing_docs = "warn" # We have many as-yet undocumented items
rust.unreachable_pub = "warn" # Potentially controversial code style
rust.unnameable_types = "warn" # Requires lint_reasons rustc feature for exceptions
# clippy.todo = "warn" # We have a lot of "real" todos
# clippy.missing_errors_doc = "warn" # Can be quite noisy?
# clippy.missing_panics_doc = "warn" # Can be quite noisy?
# clippy.partial_pub_fields = "warn" # Potentially controversial code style
# clippy.shadow_unrelated = "warn" # Potentially controversial code style
rust.missing_docs = "warn"
rust.unreachable_pub = "warn"
rust.unnameable_types = "warn"
clippy.todo = "warn"
clippy.missing_errors_doc = "warn"
clippy.missing_panics_doc = "warn"
clippy.partial_pub_fields = "warn"
clippy.shadow_unrelated = "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 = "warn"
clippy.cargo = { level = "warn", priority = -1 }

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

# Lints which we still set in individual crates lib.rs
# 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" # Note that this is allowed in Masonry
# clippy.print_stderr = "warn" # Note that this is allowed in Masonry

# Explicit per-crate exceptions
# Should be manually checked occasionally. Most enums are correctly exhaustive, as this is a vocabulary crate.
# clippy.exhaustive_enums = "warn"
2 changes: 1 addition & 1 deletion src/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ where
}

impl<T> fmt::Debug for Blob<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Blob")
.field("id", &self.id)
.finish_non_exhaustive()
Expand Down
3 changes: 1 addition & 2 deletions src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ impl Color {
#[allow(clippy::many_single_char_names)]
#[allow(clippy::unreadable_literal)]
#[must_use]
pub fn hlca(h: f64, l: f64, c: f64, a: f64) -> Color {
let alpha = a;
pub fn hlca(h: f64, l: f64, c: f64, alpha: f64) -> Color {
// The reverse transformation from Lab to XYZ, see
// https://en.wikipedia.org/wiki/CIELAB_color_space
fn f_inv(t: f64) -> f64 {
Expand Down
1 change: 1 addition & 0 deletions src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use super::{Blob, Extend};
/// Defines the pixel format of an [image](Image).
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[non_exhaustive]
pub enum Format {
/// 32-bit RGBA with 8-bit channels.
Rgba8,
Expand Down

0 comments on commit 10b0f7a

Please sign in to comment.