Skip to content

[REFAC#303] GoDoc 정합성 보강 — exported 식별자 docstring 첫 단어 식별자명 일치 - #304

Merged
juhy0987 merged 2 commits into
mainfrom
refactor/#303/godoc-consistency
May 7, 2026
Merged

juhy0987 merged 2 commits into
mainfrom
refactor/#303/godoc-consistency

Conversation

@juhy0987

@juhy0987 juhy0987 commented May 7, 2026

Copy link
Copy Markdown
Member

연관 이슈

구현 내용

#301 (PR #302) 의 후속. godoc 컨벤션 위반 검출 + 정정.

검출 결과

awk 스크립트로 `internal/`, `pkg/`, `cmd/` 의 exported func/type/const/var 직전 godoc 검사:

항목 카운트
MISMATCH (첫 단어가 식별자명 아님) 1건
MISSING (godoc 부재) 16건
본 PR 처리 대상 5건
처리 제외 (`internal/classifier/grpc/pb/*.pb.go` generated code) 12건

정정 5건

  1. `internal/storage/parsing_rule.go:23` MISMATCH `TargetTypeArticle`
    • 첫 단어 "호환성" → "TargetTypeArticle 은 ..." 으로 정정 (Deprecated 마커 보존)
  2. `internal/processor/fetcher/domain/general/handler.go:51` MISSING `NewGoQueryFetchHandler`
  3. `internal/processor/fetcher/domain/general/handler.go:113` MISSING `NewBrowserFetchHandler`
  4. `internal/processor/fetcher/domain/general/fetcher/browser.go:26` MISSING `NewBrowserFetcher`
  5. `internal/processor/fetcher/domain/general/fetcher/goquery.go:19` MISSING `NewGoqueryFetcher`

Generated code 12건 제외 사유

  • `internal/classifier/grpc/pb/classifier.pb.go` / `classifier_grpc.pb.go` — protoc 가 자동 생성
  • 직접 godoc 추가 시 다음 `protoc` 호출에 사라짐
  • golangci-lint 도 보통 generated code 제외 (`//nolint` 또는 `exclude-files`)

CI / 머지 게이트 점검

변경 영향 범위

  • 영향: 4개 `.go` 파일의 godoc only — 기능적 변경 0
  • 위험도: `Low`

Required Status Checks

  • 통과 확인 대상:
    • `Commit Lint`
    • `PR Title Lint`
    • `Linked Issue Check`
    • `Format Check`
    • `Build`
    • `Test`
    • `Lint`

로컬 검증 통과

  • `go build` 통과
  • `go test ./...` 통과 (35 패키지)
  • `go vet` 통과
  • `gofmt` 적용
  • 검출 스크립트 재실행 → 0 violation (generated code 제외)

롤백 계획

PR revert — 기능 변경 0 이라 영향 없음.

TODO (후속 권장)

  • `test/` 디렉토리 godoc 검토 — 본 PR scope 외
  • `internal/classifier/grpc/pb/*.pb.go` 의 godoc 은 `.proto` 파일에 도입 (protoc-gen-go-doc 활용) 또는 protobuf 파일 자체에 docstring 작성

🤖 Generated with Claude Code

godoc 컨벤션 위반 검출 스크립트로 5건 정정:

1. internal/storage/parsing_rule.go:23 [MISMATCH] TargetTypeArticle:
   첫 단어 "호환성" → "TargetTypeArticle 은 ..." 으로 정정. Deprecated 마커 보존.
2. internal/processor/fetcher/domain/general/handler.go:51 [MISSING] NewGoQueryFetchHandler:
   godoc 추가 — 1차 fetch + lazy escalate 신호 의도.
3. handler.go:113 [MISSING] NewBrowserFetchHandler:
   godoc 추가 — chain 마지막 link 의도.
4. internal/processor/fetcher/domain/general/fetcher/browser.go:26 [MISSING] NewBrowserFetcher:
   godoc 추가 — lazy initialize 의도.
5. internal/processor/fetcher/domain/general/fetcher/goquery.go:19 [MISSING] NewGoqueryFetcher:
   godoc 추가 — adapter 의도.

protobuf generated code (.pb.go) 12건은 본 PR scope 외 (자동 생성 — 직접 godoc 추가 시
다음 protoc 호출에 사라짐, golangci-lint 도 generated 제외).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 7, 2026 11:56
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@juhy0987 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 36 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a4bc849c-c555-4e8e-b4f4-b83aa236d6ce

📥 Commits

Reviewing files that changed from the base of the PR and between 7c8a9a5 and 6f3771a.

📒 Files selected for processing (4)
  • internal/processor/fetcher/domain/general/fetcher/browser.go
  • internal/processor/fetcher/domain/general/fetcher/goquery.go
  • internal/processor/fetcher/domain/general/handler.go
  • internal/storage/parsing_rule.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/#303/godoc-consistency

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@juhy0987 juhy0987 added the refactor Code refactoring label May 7, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation comments to several fetcher and handler constructors and updates compatibility notes for TargetTypeArticle. The review feedback suggests standardizing the naming of GoQuery across the project for consistency and refining the documentation for fetch handlers to focus on their specific roles rather than their current position in the execution chain to ensure the comments remain accurate if the chain structure changes.

Comment thread internal/processor/fetcher/domain/general/fetcher/goquery.go
Comment thread internal/processor/fetcher/domain/general/handler.go Outdated
Comment thread internal/processor/fetcher/domain/general/handler.go Outdated
gemini medium 2건 반영:
- NewGoQueryFetchHandler: '1차 fetch handler' → '정적 HTML 처리를 담당하는' (역할 중심)
- NewBrowserFetchHandler: 'chain 의 마지막 link' → '브라우저 렌더 실패 시 chain 위임 없이 job 실패' (동작 중심)

향후 chain 구성 변경 시 godoc 이 stale 되지 않도록 chain 순서 의존 표현 회피.

gemini medium #1 (GoQuery vs Goquery 명칭 혼용) 은 본 PR scope 외 — 식별자 rename 은 별도
이슈 영역 (godoc 정합성 vs 식별자 명명 컨벤션 정책 분리).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@juhy0987 juhy0987 self-assigned this May 7, 2026
@juhy0987
juhy0987 merged commit 7092720 into main May 7, 2026
8 checks passed
@juhy0987
juhy0987 removed the request for review from Copilot May 7, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] GoDoc 정합성 보강 — exported 식별자 docstring 첫 단어 식별자명 일치 + 부재 시 추가

1 participant