Skip to content

Commit

Permalink
clippy-deny the todo!() macro (#4340)
Browse files Browse the repository at this point in the history
`todo!()` shouldn't slip into prod code
  • Loading branch information
problame committed Jun 25, 2024
1 parent 07f21dd commit cd9a550
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .neon_clippy_args
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# * `-A unknown_lints` – do not warn about unknown lint suppressions
# that people with newer toolchains might use
# * `-D warnings` - fail on any warnings (`cargo` returns non-zero exit status)
export CLIPPY_COMMON_ARGS="--locked --workspace --all-targets -- -A unknown_lints -D warnings"
# * `-D clippy::todo` - don't let `todo!()` slip into `main`
export CLIPPY_COMMON_ARGS="--locked --workspace --all-targets -- -A unknown_lints -D warnings -D clippy::todo"
2 changes: 2 additions & 0 deletions libs/walproposer/src/walproposer.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::todo)]

use std::ffi::CString;

use crate::{
Expand Down
8 changes: 0 additions & 8 deletions trace/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ enum Command {

/// Print stats and anomalies about the traces
Analyze,

/// Draw the traces in svg format
Draw,

/// Send the read requests to a pageserver
Replay,
}

// HACK This function will change and improve as we see what kind of analysis is useful.
Expand Down Expand Up @@ -167,8 +161,6 @@ fn main() -> anyhow::Result<()> {
analyze_trace(reader);
}
}
Command::Draw => todo!(),
Command::Replay => todo!(),
}

Ok(())
Expand Down

1 comment on commit cd9a550

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2998 tests run: 2872 passed, 0 failed, 126 skipped (full report)


Flaky tests (3)

Postgres 16

  • test_statvfs_pressure_usage: debug
  • test_empty_branch_remote_storage_upload: debug

Postgres 14

  • test_location_conf_churn[3]: debug

Code coverage* (full report)

  • functions: 32.7% (6872 of 21002 functions)
  • lines: 50.2% (53653 of 106911 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
cd9a550 at 2024-06-25T19:34:13.303Z :recycle:

Please sign in to comment.