Skip to content

fix(lints): remove blanket clippy::all suppression and fix all warnings#183

Open
Copstud3 wants to merge 10 commits intorinafcode:mainfrom
Copstud3:fix/issue-132-enable-clippy-lints
Open

fix(lints): remove blanket clippy::all suppression and fix all warnings#183
Copstud3 wants to merge 10 commits intorinafcode:mainfrom
Copstud3:fix/issue-132-enable-clippy-lints

Conversation

@Copstud3
Copy link
Copy Markdown

  • Remove #![allow(clippy::all)]\ from teachlink/src/lib.rs and insurance/src/lib.rs
  • Replace workspace-level \�ll = allow\ in Cargo.toml with 15 targeted, documented allows under [workspace.lints.clippy]
  • Add \dead_code\ and \unused_variables\ allows under [workspace.lints.rust] to accommodate scaffolded modules that pre-declare items not yet wired up
  • Fix all resulting Clippy warnings across 30+ source and test files:
    • Remove unnecessary casts (as u64, as u32) where types already match
    • Replace manual loops with .find(), .enumerate(), .abs_diff(), .is_empty()
    • Replace .clone() on Copy types
    • Replace range checks with .contains()
    • Collapse nested ifs into compound conditions
    • Replace map_or(false, ...) with is_some_and / is_none_or
    • Replace unwrap_or(Default::default()) with unwrap_or_default()
    • Remove needless borrows for generic args
    • Prefix genuinely unused parameters with _
    • Fix bool_assert_comparison in tests (assert_eq!(x, true/false) -> assert!/assert!)
    • Remove all unused imports across 14 files
    • Remove let-and-return patterns (direct return instead)
  • Update .github/workflows/ci.yml Clippy step to use -- -D warnings -A dead_code -A unused_variables\
  • Add Linting Standards section to CONTRIBUTING.md documenting CI command, workspace-level allows with justifications, and rules for adding suppressions

Closes #132

🚀 Pull Request

📋 Description

🔗 Related Issue(s)

  • Closes #

🎯 Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📚 Documentation update
  • 🔧 Tooling/Infrastructure
  • 🧪 Test improvements
  • 🔒 Security fix
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements

📝 Changes Made

🧪 Testing

✅ Pre-Merge Checklist (Required)

  • 🧪 Unit Tests: I have run cargo test --lib and all tests pass
  • 🔨 Debug Build: I have run cargo build and the project builds successfully
  • 🎯 WASM Build: I have run cargo build --target wasm32-unknown-unknown --release and WASM builds successfully
  • 📝 Code Formatting: I have run cargo fmt --all -- --check and code is properly formatted
  • 🔍 Clippy Lints: I have run cargo clippy and there are no new warnings

🧪 Additional Testing (Recommended)

  • 📚 Documentation: I have run cargo doc --no-deps and documentation builds without errors
  • 🔒 Security Audit: I have run cargo audit and no critical vulnerabilities found
  • 🖱️ Manual Testing: I have tested this change manually (if applicable)
  • 📊 Performance: I have verified performance impact (if applicable)

📋 Test Results

cargo test --lib
# Paste output here
cargo build --target wasm32-unknown-unknown --release  
# Paste build output here

🔍 Review Checklist

📝 Code Quality

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors

🧪 Testing Requirements

  • I have added/updated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Integration tests have been updated (if applicable)

📚 Documentation

  • I have updated the documentation accordingly
  • I have updated the CHANGELOG (if applicable)

🔒 Security

  • I have not committed any secrets, keys, or sensitive data
  • I have considered security implications of my changes
  • My changes do not introduce known vulnerabilities

🏗️ Contract-Specific (if applicable)

  • Storage changes are backward compatible (or migration plan provided)
  • Event emissions are appropriate and documented
  • Error handling is comprehensive
  • Gas/resource usage has been considered

📸 Screenshots/Recordings

💥 Breaking Changes

  • This PR introduces breaking changes
  • What breaks:
  • Migration path:

📊 Performance Impact

  • CPU/Memory:
  • Gas costs:
  • Network:

🔒 Security Considerations

  • Risks:
  • Mitigations:

📖 Additional Context

  • Links:
  • Discussions:
  • Examples:

🚀 Deployment Notes

  • Requires contract redeployment
  • Requires data migration
  • Requires configuration changes
  • No deployment changes needed

📋 Reviewer Checklist

  • 📝 Code review completed
  • 🧪 Tests verified
  • 📚 Documentation reviewed
  • 🔒 Security considerations reviewed
  • 🏗️ Architecture/design reviewed
  • ✅ Approved for merge

🤖 CI Status

  • 📝 Code Formatting: ✅/❌
  • 🔍 Clippy Lints: ✅/❌
  • 🧪 Unit Tests: ✅/❌
  • 🔨 Debug Build: ✅/❌
  • 🎯 WASM Release Build: ✅/❌
  • 📚 Documentation: ✅/❌
  • 🔒 Security Audit: ✅/⚠️

🎯 Ready for Review:

  • Yes, all required checks pass and I'm ready for review
  • No, I need to fix some issues first

Thank you for contributing to TeachLink! 🚀

…gs (rinafcode#132)

- Remove \#![allow(clippy::all)]\ from teachlink/src/lib.rs and insurance/src/lib.rs
- Replace workspace-level \�ll = allow\ in Cargo.toml with 15 targeted,
  documented allows under [workspace.lints.clippy]
- Add \dead_code\ and \unused_variables\ allows under [workspace.lints.rust]
  to accommodate scaffolded modules that pre-declare items not yet wired up
- Fix all resulting Clippy warnings across 30+ source and test files:
  - Remove unnecessary casts (as u64, as u32) where types already match
  - Replace manual loops with .find(), .enumerate(), .abs_diff(), .is_empty()
  - Replace .clone() on Copy types
  - Replace range checks with .contains()
  - Collapse nested ifs into compound conditions
  - Replace map_or(false, ...) with is_some_and / is_none_or
  - Replace unwrap_or(Default::default()) with unwrap_or_default()
  - Remove needless borrows for generic args
  - Prefix genuinely unused parameters with _
  - Fix bool_assert_comparison in tests (assert_eq!(x, true/false) -> assert!/assert!)
  - Remove all unused imports across 14 files
  - Remove let-and-return patterns (direct return instead)
- Update .github/workflows/ci.yml Clippy step to use
  \-- -D warnings -A dead_code -A unused_variables\
- Add Linting Standards section to CONTRIBUTING.md documenting CI command,
  workspace-level allows with justifications, and rules for adding suppressions

Closes rinafcode#132
@github-actions
Copy link
Copy Markdown

🎉 Welcome to TeachLink, @Copstud3!

Thank you for your first contribution! A maintainer will review your PR soon.

While you wait:

  • Make sure all CI checks pass ✅
  • Review the PR checklist
  • Join our Discord to connect with the community

We appreciate your contribution to decentralized education! 🎓

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 25, 2026

@Copstud3 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ISTIFANUS-N
Copy link
Copy Markdown
Contributor

@Copstud3 resolve conflicts.

…gs (rinafcode#132)

- Remove \#![allow(clippy::all)]\ from teachlink/src/lib.rs and insurance/src/lib.rs
- Replace workspace-level \�ll = allow\ in Cargo.toml with 15 targeted,
  documented allows under [workspace.lints.clippy]
- Add \dead_code\ and \unused_variables\ allows under [workspace.lints.rust]
  to accommodate scaffolded modules that pre-declare items not yet wired up
- Fix all resulting Clippy warnings across 30+ source and test files:
  - Remove unnecessary casts (as u64, as u32) where types already match
  - Replace manual loops with .find(), .enumerate(), .abs_diff(), .is_empty()
  - Replace .clone() on Copy types
  - Replace range checks with .contains()
  - Collapse nested ifs into compound conditions
  - Replace map_or(false, ...) with is_some_and / is_none_or
  - Replace unwrap_or(Default::default()) with unwrap_or_default()
  - Remove needless borrows for generic args
  - Prefix genuinely unused parameters with _
  - Fix bool_assert_comparison in tests (assert_eq!(x, true/false) -> assert!/assert!)
  - Remove all unused imports across 14 files
  - Remove let-and-return patterns (direct return instead)
- Update .github/workflows/ci.yml Clippy step to use
  \-- -D warnings -A dead_code -A unused_variables\
- Add Linting Standards section to CONTRIBUTING.md documenting CI command,
  workspace-level allows with justifications, and rules for adding suppressions

Closes rinafcode#132
…nization

- Cleaned up test files by removing unnecessary merge conflict markers.
- Updated test files to ensure proper formatting and organization.
- Enhanced readability by adjusting comments and structuring code.
- Ensured all tests compile and run successfully after modifications.
- Cleaned up whitespace and formatting in test files across multiple modules.
- Ensured consistent use of imports and structuring of test functions.
- Enhanced clarity by grouping related imports and maintaining a uniform style.
- Verified that all tests compile and run successfully after modifications.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disabled Clippy Lints

2 participants