fix: resolve 533 clippy warnings, update bytes/time advisories #343
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
| name: Code Quality | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| metrics: | |
| name: Code Metrics | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Count lines of code | |
| run: | | |
| echo "## Code Statistics" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Total Rust files: $(find code/crates -name '*.rs' | wc -l)" >> $GITHUB_STEP_SUMMARY | |
| echo "Total lines: $(find code/crates -name '*.rs' -exec wc -l {} + | tail -1 | awk '{print $1}')" >> $GITHUB_STEP_SUMMARY | |
| - name: Check file sizes | |
| run: | | |
| echo "## File Size Compliance" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| MAX_LINES=1000 | |
| VIOLATIONS=$(find code/crates -name '*.rs' -exec wc -l {} + | awk -v max=$MAX_LINES '$1 > max {print}' | wc -l) | |
| if [ $VIOLATIONS -eq 0 ]; then | |
| echo "✅ All files under $MAX_LINES lines" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "⚠️ $VIOLATIONS files exceed $MAX_LINES lines" >> $GITHUB_STEP_SUMMARY | |
| find code/crates -name '*.rs' -exec wc -l {} + | awk -v max=$MAX_LINES '$1 > max {print}' >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Count unwraps | |
| run: | | |
| echo "## Unwrap Usage" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| UNWRAPS=$(grep -r "\.unwrap()" code/crates --include="*.rs" | wc -l) | |
| echo "Total unwraps: $UNWRAPS" >> $GITHUB_STEP_SUMMARY | |
| - name: Count TODOs | |
| run: | | |
| echo "## TODO/FIXME Count" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| TODOS=$(grep -r "TODO\|FIXME\|XXX\|HACK" code/crates --include="*.rs" | wc -l) | |
| echo "Total TODOs: $TODOS" >> $GITHUB_STEP_SUMMARY | |
| benchmarks: | |
| name: Performance Benchmarks | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Run benchmarks | |
| run: | | |
| cargo bench --workspace --no-fail-fast || true | |