ci: add weeder check for unused code detection#243
Conversation
Code Review - PR #243: CI Weeder CheckSummaryThis PR adds weeder (unused code detection) to the CI pipeline. The implementation is solid overall, with good caching strategy and proper artifact management. ✅ Strengths
🔧 Suggested Improvements1. Reduce artifact size (Performance)Uploading entire - name: Upload build artifacts for weeder
uses: actions/upload-artifact@v4
with:
name: weeder-artifacts
path: |
.hiefiles
dist-newstyle/**/*.conf
retention-days: 1Then combine downloads: - name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: weeder-artifactsImpact: Faster upload/download, less storage, reduced CI time. 2. Consolidate GHC options (Code Quality)Line 72 duplicates GHC options from line 66. Use single build command - the 3. Add validation (Reliability)Add check before running weeder: - name: Run weeder
run: |
if [ ! -d ".hiefiles" ]; then
echo "Error: HIE files not found"
exit 1
fi
~/.local/bin/weeder --config config/weeder.toml4. Minor: PATH vs absolute path (Code Style)Instead of - name: Run weeder
run: |
export PATH="$HOME/.local/bin:$PATH"
weeder --config config/weeder.toml📊 Test Coverage
🔒 Security
📝 Other Notes
Overall: Good implementation. Main suggestion is reducing artifact size for better performance. Ready to merge with or without suggested improvements. |
Code Review: Weeder CI IntegrationSummaryThis PR adds weeder integration to detect unused code in CI. Good initiative for code quality. Issues & RecommendationsCritical: Artifact Upload Size 🔴Lines 74-81: Uploading entire
Redundant Validation
|
Adds a weeder step to the PR Build and Test job that walks .hie files under dist-newstyle (already populated because package.yaml passes -fwrite-ide-info globally) and surfaces unused functions / types. Marked continue-on-error so it doesn't block PRs while the existing backlog of findings (~128 at the time of writing — Pages/Monitors, Tier2, Onboarding, Endpoints …) gets triaged. Flip the flag back once the queue is drained. config/weeder.toml: replace the hand-rolled list of root file paths with weeder's idiomatic root-modules regexes — covers CLI executable, proto-lens autogen, Devel REPL, System.Logging/Tracing, and Data.Effectful.* effect wrappers.
9bb6a77 to
7bf9ad0
Compare
Code ReviewOverviewAdds weeder dead-code detection to CI and revamps Concerns1. No version pin on cabal install weeder --install-method=copy ...Without a version constraint this will silently pick up a new major release if one ships, potentially changing which declarations are flagged or breaking the invocation. Pin it: cabal install weeder-2.9.0 --install-method=copy ...2. Cold-install cost on every CI run
3.
"^System\\.Logging$",
"^System\\.Tracing$",are anchored with "^System\\.Logging",
"^System\\.Tracing",4. Weeder will walk every Minor / Nitpicks
SummaryGood addition overall — the |
Closes #
How to test
Checklist