Skip to content

Conversation

@tangowithfoxtrot
Copy link
Contributor

@tangowithfoxtrot tangowithfoxtrot commented Nov 24, 2025

🎟️ Tracking

📔 Objective

Rust 1.81 stabilized the #[expect] attribute. This attribute acts very similarly to #[allow], in that it allows for the suppression of various style lints. Unlike #[allow], however, it tells the linter to expect that you are overriding a linter warning. If the override is no longer applicable, then #[expect] will throw a warning stating that the lint suppression is no longer needed so that you can remove it.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@github-actions
Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Details9f7af9cb-84f6-40a8-928f-0f46d4716efd

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 15.42%. Comparing base (2cc86e4) to head (fb6bcfb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1385   +/-   ##
=======================================
  Coverage   15.42%   15.42%           
=======================================
  Files          21       21           
  Lines        1193     1193           
=======================================
  Hits          184      184           
  Misses       1009     1009           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tangowithfoxtrot tangowithfoxtrot marked this pull request as ready for review November 24, 2025 16:52
@tangowithfoxtrot tangowithfoxtrot requested a review from a team as a code owner November 24, 2025 16:52
@claude
Copy link

claude bot commented Nov 24, 2025

Claude finished @tangowithfoxtrot's task —— View job


Code Review Complete

  • Read changed files
  • Check for remaining #[allow()] instances
  • Evaluate PR metadata quality
  • Provide review findings

Summary

This PR successfully replaces all #[allow()] attributes with #[expect()] and enforces this practice via the new allow-attributes = "deny" Clippy lint. The changes are minimal, focused, and correctly implemented across 5 files.

Critical Issues

None.

Suggested Improvements

Finding 1: 💭 PR description could benefit from a test plan section

The PR checklist includes "All formatters and local linters executed and passed" as checked, but the description lacks a concrete test plan. Consider adding:

Suggested addition to PR description
## Test Plan

- [x] Ran `cargo +nightly fmt` - no formatting issues
- [x] Ran `cargo clippy --all-features --tests` - all lints pass
- [x] Verified no `#[allow()]` attributes remain in codebase
- [x] Confirmed lint enforcement with `allow-attributes = "deny"` prevents future violations

Finding 2: 🎨 Consider documenting the rationale for specific #[expect()] usages

Three of the #[expect()] attributes suppress style lints that may not be immediately obvious to future contributors:

  • crates/bws/src/cli.rs:17 - #[expect(non_camel_case_types)] on ProfileKey enum
  • crates/bws/src/cli.rs:28 - #[expect(clippy::upper_case_acronyms)] on Output enum
  • crates/sdk-schemas/src/main.rs:90 - #[expect(dead_code)] on SchemaTypes struct

While #[expect()] will alert if these become unnecessary, inline comments explaining why these suppressions are intentional would improve maintainability:

// Profile keys must match config file format (snake_case)
#[expect(non_camel_case_types)]
pub(crate) enum ProfileKey { ... }

// Output format names follow common convention (JSON, YAML, etc.)
#[expect(clippy::upper_case_acronyms)]
pub(crate) enum Output { ... }

// Schema types only used for derive macro code generation
#[expect(dead_code)]
struct SchemaTypes { ... }

Good Practices Observed

  • Clean enforcement via workspace-level Clippy lint configuration
  • Removal of unnecessary attributes (e.g., #[allow(unused_imports)] replaced with proper #[cfg(test)])
  • Proper cleanup of obsolete suppression (#[allow(clippy::comparison_chain)] removed entirely)

Action Items

None required - the PR is functionally complete. The improvement suggestions above are optional enhancements for documentation clarity.

@tangowithfoxtrot tangowithfoxtrot changed the title style: use #[expect()] instead of #[allow()] style: use #[expect] instead of #[allow] Nov 24, 2025
@tangowithfoxtrot tangowithfoxtrot merged commit abda0ca into main Nov 24, 2025
99 of 101 checks passed
@tangowithfoxtrot tangowithfoxtrot deleted the prefer-expect-over-allow branch November 24, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants