[chore] solution,admin,ontology: 코드 주석을 한 줄로 — 히스토리 주석 삭제
여러 줄 주석이 설명보다 경위(예전·실측·지적)를 적고 있어 읽는 사람이 결론을 찾기 어려웠다. - ts·tsx·js·mjs·css·py 478개: 여러 줄 주석은 첫 문장 한 줄로, 과거형·날짜 문장은 삭제 - 주석 위치는 TypeScript 파서·파이썬 tokenize/ast 로 찾는다 — 문자열 안의 # · /* 는 건드리지 않는다 - eslint·ts·noqa·type: ignore 같은 지시 주석은 그대로 둔다 파이썬 275개 정리 전후 AST 동일, TS 298개 주석 뺀 토큰 동일(빈 JSX 주석 10곳만 차이). site·frontend·admin tsc, site vitest 105 passed Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c6908629f3
commit
11d30bb3d1
479 files changed
+3337
-13091
No files matched your search
@@ -34,7 +34,7 @@ SITE_HOST_ENV = "SITE_PUBLIC_HOST"
|
||||
DEFAULT_HOST = os.environ.get(SITE_HOST_ENV, "").strip() or "localhost"
|
||||
|
||||
def _scheme(host: str) -> str:
|
||||
"""localhost 는 http 다. shared/lib/slug.ts publishUrl 과 같은 규칙."""
|
||||
"""localhost 는 http 다."""
|
||||
return "http" if re.match(r"^(localhost|127\.0\.0\.1)(:\d+)?$", host) else "https"
|
||||
|
||||
# 링크 제목이 비었을 때 채우는 채널 이름.
|
||||
@@ -180,7 +180,7 @@ def _fact_entry(spec, row: dict) -> dict:
|
||||
|
||||
|
||||
def _theme(site, category: int) -> dict:
|
||||
"""SiteTheme. 모양(look)은 템플릿 정의가, 색·섹션은 저장된 theme이 정한다. 잘못된 templateId면 UnknownTemplate."""
|
||||
"""SiteTheme."""
|
||||
template_id = resolve_template_id(category, _text(_get(site, "template_id")))
|
||||
template = TEMPLATES[template_id]
|
||||
saved = _get(site, "theme")
|
||||
@@ -280,7 +280,7 @@ def _weather_condition(code) -> str:
|
||||
|
||||
|
||||
def _weather(row: dict):
|
||||
"""WeatherSnapshot. 값이 없으면 None — 없는 날씨를 지어내지 않는다."""
|
||||
"""WeatherSnapshot."""
|
||||
body = row.get("body") or {}
|
||||
temperature = _as_float(body.get("temperature"))
|
||||
observed_at = _text(body.get("observed_at"))
|
||||
@@ -309,7 +309,7 @@ _SEASON_BY_MONTH = {
|
||||
|
||||
|
||||
def _festival(row: dict):
|
||||
"""FestivalEntry. 이름이 없으면 버린다 — 이름 없는 행사는 화면에 걸 수 없다."""
|
||||
"""FestivalEntry."""
|
||||
body = row.get("body") or {}
|
||||
name = _text(body.get("name")) or _text(row.get("title"))
|
||||
if not name:
|
||||
@@ -376,7 +376,7 @@ def _local_place(row: dict, category: str):
|
||||
|
||||
|
||||
def _put_distance(entry: dict, body: dict) -> None:
|
||||
"""distanceMeters → distanceText("850m") + distanceMeters(850). 값이 없거나 음수면 둘 다 넣지 않는다."""
|
||||
"""distanceMeters → distanceText("850m") + distanceMeters(850)."""
|
||||
# 원값은 사이트 개인화(site_sections.data.places[].distanceMeters)에서 온다 — 공용 실체에는 거리가 없다(업장마다 다르다).
|
||||
meters = body.get("distanceMeters")
|
||||
distance = _distance_text(meters)
|
||||
@@ -387,7 +387,7 @@ def _put_distance(entry: dict, body: dict) -> None:
|
||||
|
||||
|
||||
def _distance_text(meters) -> str:
|
||||
"""850 → "850m", 1234 → "1.2km". 없으면 빈 문자열."""
|
||||
"""850 → "850m", 1234 → "1.2km"."""
|
||||
try:
|
||||
m = int(meters)
|
||||
except (TypeError, ValueError):
|
||||
@@ -726,7 +726,7 @@ def _as_float(value):
|
||||
|
||||
# ── 파일 출력 ─────────────────────────────────────────────────────────────
|
||||
def payload_dir() -> Path:
|
||||
"""payload 출력 디렉토리. 컨테이너 밖 볼륨을 붙이기 쉬우라고 env 로 뺀다."""
|
||||
"""payload 출력 디렉토리."""
|
||||
return Path(os.environ.get(PAYLOAD_DIR_ENV) or DEFAULT_PAYLOAD_DIR)
|
||||
|
||||
|
||||
@@ -746,7 +746,7 @@ def write_payload(payload: dict) -> str:
|
||||
|
||||
|
||||
async def prepare_site_payload(place, snapshot: dict, site, version, links, publish: bool = False) -> dict:
|
||||
"""미리보기·발행 공통 보강. 요약은 DB 스냅샷이 아니라 응답/산출물에만 싣는다."""
|
||||
"""미리보기·발행 공통 보강."""
|
||||
payload = to_site_payload(place, snapshot, site, version, links, publish)
|
||||
for fact in payload["facts"]:
|
||||
if fact["key"] != "intro" or fact["status"] not in {s.value for s in PUBLISHABLE_FACT_STATUSES}:
|
||||
|
||||
Reference in new issue
Block a user