Commit graph

12 commits

Author SHA1 Message Date
Kevin Turcios
bd3ec8f09d test: sync dual-changed test files from main with omni-java fixes
Updates inject_profiling_into_existing_test calls to include test_string
parameter. Takes main's test refactoring for multi-file code replacement
and codeflash capture.
2026-03-02 15:30:16 -05:00
Kevin Turcios
c74782757b Merge commit '6346c740' into sync-main-batch-4
# Conflicts:
#	.github/workflows/windows-unit-tests.yml
#	codeflash/code_utils/config_consts.py
#	codeflash/code_utils/instrument_existing_tests.py
#	codeflash/languages/python/context/unused_definition_remover.py
#	codeflash/languages/python/static_analysis/code_replacer.py
#	codeflash/optimization/function_optimizer.py
#	codeflash/optimization/optimizer.py
#	pyproject.toml
2026-02-19 21:26:23 -05:00
misrasaurabh1
7b72a7e6ad fix: prevent optimized code from one file being applied to another file
The bug was introduced in commit 06353ea1 which added a fallback that
applied a single code block to ANY file being processed. This caused
issues like PR #1309 where normalize_java_code was duplicated in
support.py because optimized code for formatter.py was incorrectly
applied to it.

The fix restricts the single-code-block fallback to non-Python languages
only, where flexible path matching is needed (Java/JS/TS). For Python,
exact path matching is now required.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 14:45:51 -08:00
misrasaurabh1
198487bf81 format and lint all 2026-01-29 01:39:48 -08:00
Kevin Turcios
7b33e8b7f6 refactor: smarter placement of global assignments based on dependencies
Assignments that don't reference module-level definitions are now placed
right after imports. Only assignments that reference classes/functions
are placed after those definitions to prevent NameError.
2026-01-24 06:29:39 -05:00
Kevin Turcios
257c5f2b8f test: update test expectations for global assignment placement changes
Update test_no_targets_found to expect outer class to be kept when
targeting nested class methods, and add test for nonexistent targets.
Update test_multi_file_replcement01 to expect global assignments at
module end rather than after imports.
2026-01-24 06:19:48 -05:00
ali
c5b1d30319
add global assignments after the imports
Signed-off-by: ali <mohammed18200118@gmail.com>
2025-08-22 15:52:15 +03:00
mohammed
989b1f30a2
unit tests fixing 2025-08-06 03:33:46 +03:00
mohammed
07a9365987
send&recieve markdown code 2025-08-06 01:09:42 +03:00
mohammed
3eee162d41
fix markdown context for formatting and more refactoring 2025-08-04 15:35:28 +03:00
mohammed
654a6ec251
refactoring 2025-07-26 08:49:23 +03:00
mohammed
57f8af0860
test multifile replacement 2025-07-26 07:24:20 +03:00