feat: enforce clippy warnings as errors in CI (#350)#395
Merged
Sundayabel222 merged 1 commit intoJul 2, 2026
Merged
Conversation
|
@iam-mercy 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! 🚀 |
Contributor
|
fix conflict @iam-mercy |
…an-Smart-Block-Explorer#350) - Enhanced clippy check to use --all-targets --all-features - Added comprehensive clippy enforcement documentation - Resolves conflicts by rebasing on latest main - No changes to deleted contract-tests.yml (already consolidated into ci.yml) Closes Soroban-Smart-Block-Explorer#350
ca0bf6d to
6310d14
Compare
Contributor
Conflicts Resolved ✅Updated the PR to resolve all merge conflicts: Changes Made
What Changed in CI\\yaml Beforecargo clippy -- -D warnings Aftercargo clippy --all-targets --all-features -- -D warnings The --all-targets flag ensures clippy checks:
The --all-features flag ensures all feature-gated code is linted. Ready to Merge
This PR is now ready for review and merge! |
Contributor
Author
|
conflicts has been resolved @Sundayabel222 |
1498f15
into
Soroban-Smart-Block-Explorer:main
3 of 4 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #350
This PR adds strict clippy linting enforcement to CI pipelines to address issue #350. All clippy warnings will now be treated as errors and fail the build, preventing code quality degradation.
Changes Made
1. CI Workflow Updates (
.github/workflows/ci.yml)Before:
```bash
cargo clippy
```
After:
```bash
cargo clippy --all-targets --all-features -- -D warnings
```
2. Contract Tests Workflow Updates (
.github/workflows/contract-tests.yml)```bash
cargo clippy --all-targets --features testutils -- -D warnings
```
3. Documentation (
.docs/clippy-enforcement.md)Comprehensive documentation covering:
Benefits
✅ Prevents Code Quality Degradation: Warnings caught before merge
✅ Consistency: Same standards enforced for all contributors
✅ Early Detection: Issues found in CI rather than code review
✅ Automated: No manual checking required
✅ Comprehensive: Lints all targets including tests and examples
Impact
Breaking Changes
If there are any existing clippy warnings in the codebase, they will need to be fixed before this PR can merge. To check:
```bash
Check explorer contract
cargo clippy --all-targets --all-features -- -D warnings
Check ticket contract
cd contracts/ticket
cargo clippy --all-targets --features testutils -- -D warnings
```
CI Workflow Changes
Testing
Local Testing
Tested locally with:
```bash
cargo clippy --all-targets --all-features -- -D warnings
```
CI Testing
Once merged, CI will:
Developer Experience
Before Committing
Developers should run locally:
```bash
cargo clippy --all-targets --all-features -- -D warnings
```
IDE Integration
Configure your IDE to run clippy on save:
Fixing Issues
Most clippy issues can be auto-fixed:
```bash
cargo clippy --fix --all-targets --all-features -- -D warnings
```
Rollout Plan