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

7.0.x: handful of clippy cleanups - v1 #12618

Merged
merged 8 commits into from
Feb 20, 2025

Conversation

jasonish
Copy link
Member

  • mqtt: always use 0x notation for hex in tests
  • rust: allow vec_init_then_push in tests
  • rust: fix assertions_on_constants for assert!(false)
  • rust: fix single_binding
  • rust: fix assertions_on_constants for assert!(true)
  • dns: fix clippy lint warnings
  • rust: allow clippy::unused_unit for tests that use the test macro
  • dns: refactor tests to avoid assert!(false)

jasonish and others added 8 commits February 18, 2025 15:32
Fixes clippy lint for zero_prefixed_literal.
To supress the clippy lint in tests.
using panic! instead with a string message

(cherry picked from commit a8199bf)
error: this match could be written as a `let` statement
   --> src/nfs/nfs3_records.rs:747:9
    |
747 | /         match result {
748 | |             (r, request) => {
749 | |                 assert_eq!(r.len(), 0);
750 | |                 assert_eq!(request.handle, expected_handle);
751 | |                 assert_eq!(request.name_vec, br#"bln"#);
752 | |             }
753 | |         }
    | |_________^

(cherry picked from commit 259cdf1)
Which will be optimized away by the compiler

(cherry picked from commit c49463c)
Fix vector lint issues:
- same_item_push
- vec_init_then_push

(cherry picked from commit 2c0d3b8)
The cause of the issue comes from the macro, which is provided by a
crate. Bust just to allow this for now.
Mostly just unwrap instead of match as unwrap provides good
context. And replace a few assert!(false) with a descriptive panic.
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

Attention: Patch coverage is 99.24812% with 3 lines in your changes missing coverage. Please review.

Project coverage is 83.29%. Comparing base (9516f0a) to head (ac62d1b).
Report is 8 commits behind head on main-7.0.x.

Additional details and impacted files
@@              Coverage Diff               @@
##           main-7.0.x   #12618      +/-   ##
==============================================
+ Coverage       83.27%   83.29%   +0.02%     
==============================================
  Files             922      922              
  Lines          261201   261076     -125     
==============================================
- Hits           217504   217458      -46     
+ Misses          43697    43618      -79     
Flag Coverage Δ
fuzzcorpus 64.30% <ø> (+<0.01%) ⬆️
suricata-verify 63.51% <ø> (+0.01%) ⬆️
unittests 62.37% <99.24%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information:

ERROR: QA failed on SURI_TLPW2_autofp_suri_time.

ERROR: QA failed on SURI_TLPR1_suri_time.

field baseline test %
SURI_TLPR1_stats_chk
.uptime 633 690 109.0%

Pipeline 24777

Copy link
Member

@inashivb inashivb left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@suricata-qa
Copy link

Information:

ERROR: QA failed on SURI_TLPW2_autofp_suri_time.

field baseline test %
SURI_TLPW2_autofp_stats_chk
.uptime 146 141 96.58%

Pipeline 24782

@victorjulien victorjulien merged commit ac62d1b into OISF:main-7.0.x Feb 20, 2025
88 checks passed
@victorjulien
Copy link
Member

Merged in #12630, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants