fix(reverse_sync): improved MDX trailing whitespace 입력값 검증 추가#908
Merged
fix(reverse_sync): improved MDX trailing whitespace 입력값 검증 추가#908
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 task
dc84e27 to
fec2457
Compare
9f5c927 to
9a61179
Compare
jk-kim0
added a commit
that referenced
this pull request
Mar 12, 2026
## Description `verify_roundtrip`의 strict 모드에서도 forward converter의 체계적 출력 특성에 의한 차이를 정규화하여 false negative를 줄입니다. **추가된 최소 정규화 (strict/lenient 공통 적용):** - `_normalize_consecutive_spaces_in_text`: 코드 블록 외 영역에서 2개 이상 연속 공백을 단일 공백으로 정규화 - 배경: `improved.mdx`에 `**bold** :` 형태의 이중 공백이 있어도 forward converter는 단일 공백으로 출력 - `_normalize_br_space`: `<br/>` 앞의 공백 제거 - 배경: forward converter가 `' '.join(li_itself)`로 `<br/>` 앞에 공백을 추가 **변경하지 않은 것:** - `_normalize_trailing_ws`는 최소 정규화에 포함하지 않음 (strict 모드의 trailing whitespace 검사 보존) ## Added/updated tests? - [x] Yes `TestNormalizeConsecutiveSpaces` (5개), `TestNormalizeBrSpace` (5개), 통합 테스트 3개 추가 — 총 22개 테스트 통과 ## Stacked PRs 이 PR은 stacked PR 시리즈의 일부입니다: - #906 (이 PR): 최소 정규화 (`_apply_minimal_normalizations`) - #907: `_normalize_table_cell_padding` 추가 - #908: `_normalize_trailing_ws` lenient 모드 이동 --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
5e47e47 to
94c1b91
Compare
fec2457 to
21c5068
Compare
21c5068 to
9ebe42a
Compare
9ebe42a to
d9f7856
Compare
2c27048 to
70e4fd6
Compare
ab5797d to
9746d2c
Compare
9746d2c to
95bdde5
Compare
95bdde5 to
4f5fc22
Compare
4f5fc22 to
2e1d360
Compare
reverse-sync verify 실행 시 improved MDX에 trailing whitespace가 있으면 즉시 입력값 오류로 실패하도록 검증 단계를 추가합니다. - run_verify()에서 improved MDX를 읽은 직후 trailing whitespace 검사 - 발견 시 에러 메시지와 함께 파일명, 줄 번호, 해당 줄 내용을 출력 - ValueError를 raise하여 main()의 기존 에러 핸들러가 처리 - run-tests.sh: result.yaml이 없을 때 cp/status 오류 없이 처리 trailing whitespace는 reverse-sync 코드의 버그가 아니라 입력값(improved MDX)의 오류이므로, 진단 가능한 에러로 처리합니다. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2e1d360 to
94a73d0
Compare
trailing whitespace 제거 후 CI 결과와 다시 맞춥니다. - expected_status: fail → pass (verify가 pass로 전환된 케이스 8건): 543948978, 544376265, 544378513, 544383693, 565575990, 568852692, 920944732, 1177321474 - expected_status: pass → fail (verify가 여전히 fail인 케이스 8건): 543981760, 544376394, 544382364, 619381289, 798064641, 954172219, 1297383451, 1907294209 로컬 검증: reverse-sync tests → 42/42 pass Co-Authored-By: Atlas <atlas@jk.agent>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
reverse-sync verify 실행 시 improved MDX에 trailing whitespace가 있으면 즉시 입력값 오류로 실패하도록 검증 단계를 추가합니다.
trailing whitespace는 reverse-sync 코드의 버그가 아니라 입력값(improved MDX)의 오류이므로, 진단 가능한 에러로 처리합니다.
변경 내용
bin/reverse_sync_cli.pyrun_verify()에서 improved MDX를 읽은 직후 trailing whitespace 검증ValueErrorraise → 줄 번호 +repr(line)형태로 위치 출력tests/run-tests.sh--xhtml→--page-dir인자 수정 (CLI 변경 반영)result.yaml이 없을 때의 처리 수정result.yamlcp에2>/dev/null || true추가status변수 기본값을"error"로 설정하고, result.yaml이 있을 때만 읽도록 변경에러 출력 예시
Added/updated tests?
run-tests.sh수정으로 trailing whitespace 케이스의 에러 출력이 깔끔하게 표시됨🤖 Generated with Claude Code