자산 분리 검사가 gitignore 를 존중하도록 - #5
Merged
Merged
Conversation
이 검사는 저장소 폴더 전체를 훑으면서 git 추적 여부를 보지 않았다. 그래서 커밋할 생각이 없는 로컬 작업 파일(참고자료 스크린샷 등)이 있으면 라이선스 유출로 신고됐다. CI 는 clone 한 트리를 보므로 통과하고 로컬만 빨간불이 뜨는 상태가 되는데, 이러면 개발자가 게이트 결과를 믿지 않게 된다. gitignore 된 파일은 정의상 배포물에 들어가지 않으므로 유출일 수 없다. `git check-ignore` 로 걸러낸다. 면제는 딱 거기까지다 — 추적되지 않았을 뿐 gitignore 되지도 않은 파일은 곧 커밋될 수 있으므로 여전히 검사한다. git 이 없거나 저장소가 아니면 아무것도 면제하지 않고 예전처럼 전부 검사한다. `-z` 는 필수다. 없으면 git 이 비ASCII 경로를 따옴표로 감싸고 8진 이스케이프해 내보내(예: "docs/\354\235\274\354\240\225.png") 원래 경로와 대조되지 않는다. 한글 경로가 많은 이 저장소에서는 무시 설정이 통째로 먹히지 않는 결과가 된다. 회귀 방지 테스트에 한글 경로 케이스를 명시적으로 넣었다. 함께: 대회 주최측 오리엔테이션 자료(제3자 저작물)를 .gitignore 에 추가. 재배포 대상이 아니다. 테스트 5개 추가 (403 → 408).
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.
Closes #4
무엇을
scripts/check_assets_separation.py가 gitignore 된 경로를 건너뛴다.왜
이 검사가 지키려는 것은 배포되는 트리의 라이선스 분리(CC BY-SA 픽토그램 ↔ Apache
코드)다. gitignore 된 파일은 정의상 배포물에 들어가지 않으므로 유출일 수 없다.
지금은 폴더 전체를 훑으며 git 을 전혀 참조하지 않아, 로컬 참고자료 스크린샷 하나만
있어도 유출로 신고됐다. CI 는 clone 한 트리를 보므로 초록인데 로컬만 빨간불 —
게이트 결과를 믿지 않게 만드는 상태다.
게이트를 무디게 하지 않는다
면제 범위를 좁게 잡았다.
곧 커밋될 수 있으므로 여전히 검사 대상이다.
판단할 수 없을 때 게이트를 여는 방향으로 폴백하지 않는다.
두 성질 모두 테스트로 고정했다.
-z가 필수인 이유git check-ignore --stdin은-z없이 실행하면 비ASCII 경로를 따옴표로 감싸고8진 이스케이프해서 출력한다.
이 문자열은 원래 경로와 매칭되지 않는다. 한글 경로가 많은 이 저장소에서는 무시
설정이 통째로 먹히지 않는다 — 실제로 구현 중에 이 증상을 밟았다. 한글 경로
케이스를 회귀 테스트로 고정했다.
함께
대회 주최측이 배포한 오리엔테이션 자료(
docs/contest/ot-2026/)를.gitignore에추가. 제3자 저작물이라 재배포 대상이 아니다.
검증
테스트 5개 추가 (403 → 408) · ruff clean ·
ttobak auditPASS새 테스트: