Skip to content

Instantly share code, notes, and snippets.

@desamtralized
Created May 23, 2025 22:05
Show Gist options
  • Select an option

  • Save desamtralized/84c62a191175a9e8111fc51f11408230 to your computer and use it in GitHub Desktop.

Select an option

Save desamtralized/84c62a191175a9e8111fc51f11408230 to your computer and use it in GitHub Desktop.
Based on the analysis in @unused_constants.md, systematically remove unused constants from the test files. Follow these guidelines:
**Scope & Priority:**
- Start with constants used 0 times (truly unused)
- Then consider constants used only 1 time if they appear to be test-specific and not providing meaningful value
- Work on one test file at a time, starting with the smallest files first
**Process:**
1. **Before making changes:** Read the target test file completely to understand context
2. **Remove constants carefully:** Only remove those that are clearly unused or redundant
3. **Update tracking:** Mark progress in unused_constants.md using the checkbox system:
- `[x]` for successfully removed constants
- `[!]` for constants that cannot be removed (with explanation)
- `[?]` for constants needing human review
4. **Verify changes:** Run `cargo test` on the specific test file to ensure no breakage
5. **Final verification:** Run full test suite for the modified file
**Safety rules:**
- Do NOT remove constants that might be used in macros, conditional compilation, or generated code
- Do NOT make any other code changes beyond removing unused constants
- If a constant removal causes test failures, restore it and mark as `[!]` with explanation
- Stop after completing one test file and report progress
**Start with:** The file with the fewest unused constants to validate the approach first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment