Normalize fullwidth punctuation to ASCII across codebase.

Add scripts/normalize_ambiguous_unicode.py; fix corrupted patch_instance_theme_templates.py. Preserves curly quotes in string literals; removes Git homoglyph warnings on .env.example.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-08 23:42:26 +08:00
parent aaa72c7961
commit b733e551a0
392 changed files with 71522 additions and 71369 deletions
+30 -30
View File
@@ -1,30 +1,30 @@
from lib.trade.trade_result_lib import normalize_result_with_pnl, normalize_display_result, is_winning_pnl
def test_stop_loss_with_profit_becomes_trailing_tp():
assert normalize_result_with_pnl("止损", 4.33) == "移动止盈"
def test_manual_close_unchanged_even_with_profit():
assert normalize_result_with_pnl("手动平仓", 10) == "手动平仓"
def test_stop_loss_with_loss_unchanged():
assert normalize_result_with_pnl("止损", -2.5) == "止损"
def test_take_profit_unchanged():
assert normalize_result_with_pnl("止盈", 5) == "止盈"
def test_external_close_becomes_manual_close():
assert normalize_display_result("外部平仓") == "手动平仓"
assert normalize_result_with_pnl("外部平仓", 2.5) == "手动平仓"
assert normalize_result_with_pnl("外部平仓自动同步", -1) == "手动平仓"
def test_winning_pnl_positive_only():
assert is_winning_pnl(2.96) is True
assert is_winning_pnl(0) is False
assert is_winning_pnl(-1.05) is False
assert is_winning_pnl(None) is False
from lib.trade.trade_result_lib import normalize_result_with_pnl, normalize_display_result, is_winning_pnl
def test_stop_loss_with_profit_becomes_trailing_tp():
assert normalize_result_with_pnl("止损", 4.33) == "移动止盈"
def test_manual_close_unchanged_even_with_profit():
assert normalize_result_with_pnl("手动平仓", 10) == "手动平仓"
def test_stop_loss_with_loss_unchanged():
assert normalize_result_with_pnl("止损", -2.5) == "止损"
def test_take_profit_unchanged():
assert normalize_result_with_pnl("止盈", 5) == "止盈"
def test_external_close_becomes_manual_close():
assert normalize_display_result("外部平仓") == "手动平仓"
assert normalize_result_with_pnl("外部平仓", 2.5) == "手动平仓"
assert normalize_result_with_pnl("外部平仓(自动同步)", -1) == "手动平仓"
def test_winning_pnl_positive_only():
assert is_winning_pnl(2.96) is True
assert is_winning_pnl(0) is False
assert is_winning_pnl(-1.05) is False
assert is_winning_pnl(None) is False