Skip to content

Conversation

@iddan
Copy link

@iddan iddan commented Dec 16, 2025

Overview

This PR contains performance improvements, bug fixes, code cleanup, and enhanced testing for the codemod tool.

Key Changes

🐛 Bug Fixes

  • Fix not forcing to source rules (9b53d51)

    • Fixed issue where source file filtering rules were not being properly enforced
    • Updated src/transform.ts to correctly apply source file filtering
  • Disallow critical errors (003b5a9)

    • Added critical error handling to prevent the tool from continuing with fatal issues
    • Enhanced error validation in the CLI and runner
    • Added critical flag to error types

⚡ Performance Improvements

  • Read file once (5b53f52)

    • Optimized file reading to avoid reading files multiple times
    • Improved efficiency in file-processor.ts and runner.ts
  • Use iterator for source files (09e2991)

    • Refactored file processing to use iterators instead of loading all files into memory
    • More memory-efficient processing for large codebases
    • Updated runner.ts and file-processor.ts to use iterator pattern

🧹 Code Cleanup

  • Remove unused code (c11865c)

    • Removed 55 lines of unused code from runner.ts
  • Remove not implemented stats (15b7e8b)

    • Removed unimplemented statistics tracking code
    • Cleaned up runner.ts, types.ts, and logger.ts
    • Simplified codebase by removing dead code paths

🎨 Code Quality

  • Add Prettier (ad2faf8)
    • Added Prettier configuration (.prettierrc)
    • Updated package.json with Prettier scripts and dependencies
    • Ensures consistent code formatting across the project

🧪 Testing

  • Add e2e test for the CLI (bd76edf)
    • Added comprehensive end-to-end tests (test/e2e/cli-e2e.spec.ts)
    • Tests the complete CLI transformation pipeline
    • Verifies CLI behavior with actual fixture files
    • 219 lines of new test coverage

@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 7.03125% with 119 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.80%. Comparing base (fcf403f) to head (bd76edf).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
test/e2e/cli-e2e.spec.ts 1.20% 82 Missing ⚠️
src/runner.ts 11.11% 32 Missing ⚠️
src/utils/file-processor.ts 33.33% 4 Missing ⚠️
src/transform.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master       #3      +/-   ##
==========================================
- Coverage   61.57%   56.80%   -4.78%     
==========================================
  Files          23       24       +1     
  Lines         963     1044      +81     
  Branches      263      266       +3     
==========================================
  Hits          593      593              
- Misses        329      410      +81     
  Partials       41       41              
Flag Coverage Δ
unittests 56.80% <7.03%> (-4.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants