claude-code - 💡(How to fix) Fix 포맷터 설정만 추가하고 실제로 포맷터를 실행하지 않은 채 커밋 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47194Fetched 2026-04-13 05:38:58
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1
RAW_BUFFERClick to expand / collapse

문제 상황

Python 프로젝트에 ruff 설정(pyproject.toml)과 pre-commit 설정을 추가하면서, 정작 ruff format 명령을 실행하지 않은 상태로 코드를 커밋함. 추가로, 포맷터가 재포맷 대상으로 보고한 파일들을 도구 실행으로 처리하지 않고 Claude가 diff를 보고 직접 타이핑하여 포맷을 흉내내려 시도함.

재현 방법

  1. 신규 Python 프로젝트에 ruff 설정 추가 요청
  2. Claude가 pyproject.toml에 ruff 설정 기입
  3. 코드 파일 여러 개 생성
  4. ruff format 미실행 상태에서 git commit
  5. 이후 사용자가 "이 소스들이 ruff 적용된 소스 맞나?" 라고 질문하면 그제서야 ruff format --check로 미적용 사실 확인
  6. 재포맷 필요 파일을 ruff format 실행으로 처리하지 않고 Edit 툴로 직접 타이핑 시도

예상 동작

  • 포맷터 설정 추가 시, 실제 ruff format . 실행까지 수행 후 커밋
  • 재포맷이 필요한 경우, 의도적으로 유지할 블록만 # fmt: off / # fmt: on으로 감싸고, 나머지는 ruff format 도구 실행으로 자동 처리

실제 동작

  • 설정만 추가하고 포맷터 미실행 상태로 커밋
  • 재포맷 처리도 도구 실행 대신 Edit으로 직접 타이핑

비고

포맷터를 설정하는 이유 자체가 "사람/AI가 포맷 신경쓰지 말고 도구에 맡긴다"인데, Claude가 diff 보고 수동 타이핑하면 도입 의미가 사라지고 규칙과 어긋난 코드가 들어갈 위험이 있음.

extent analysis

TL;DR

Run ruff format before committing code to ensure consistent formatting.

Guidance

  • Run ruff format on the codebase before committing to apply the formatting rules defined in pyproject.toml.
  • Use ruff format --check to verify if the code is formatted correctly before committing.
  • For blocks of code that should not be formatted, use # fmt: off and # fmt: on directives to exclude them from automatic formatting.
  • Avoid manual formatting using edit tools, as it can lead to inconsistencies and defeat the purpose of using a formatter.

Notes

The issue highlights the importance of running the formatter before committing code to ensure consistency and avoid manual formatting errors.

Recommendation

Apply workaround: Run ruff format before committing code to ensure consistent formatting, as it is the intended use of the tool and helps maintain code quality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix 포맷터 설정만 추가하고 실제로 포맷터를 실행하지 않은 채 커밋 [1 comments, 2 participants]