Skip to content

Measure scanned doc sizes with LF-normalized line endings - #28

Merged
thorwhalen merged 1 commit into
mainfrom
fix/crlf-doc-size-in-scanned-projects
Sep 22, 2026
Merged

thorwhalen merged 1 commit into
mainfrom
fix/crlf-doc-size-in-scanned-projects

Conversation

@thorwhalen

@thorwhalen thorwhalen commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Post-merge adversarial review of #27 (independent reviewer, not the author).

#27 fixed the CRLF-inflated sizes (#21) only for opsward's own test fixtures, by pinning eol=lf in .gitattributes. That makes CI green but does not fix the product: projects opsward scans on a Windows host are normally checked out with CRLF (core.autocrlf=true is the Git for Windows default), so DocSpec.size_bytes (raw st_size) still differs by host. That size drives maintain's _MIN_DOC_BYTES stub check and score's empty-doc check, so the same repo could be flagged as having a stub doc on Linux and not on Windows.

Fix: scan measures doc size after normalizing CRLF to LF (_content_size). Regression test test_doc_size_ignores_crlf_line_endings writes the same doc with LF and CRLF endings and asserts equal sizes; it fails on main (52 vs 43 bytes) and passes here.

Review note: self-reviewed only (the post-merge reviewer's own fix; no further sub-agent was spawned).

🤖 Generated with Claude Code

#27 fixed the CRLF-inflated sizes only for opsward's own fixtures (via
.gitattributes). Projects that opsward scans are still checked out with
CRLF on Windows (core.autocrlf=true is the Git for Windows default), so
the stub heuristics driven by DocSpec.size_bytes gave host-dependent
answers. Count bytes after normalizing CRLF to LF, with a regression test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit 7b5d14f into main Sep 22, 2026
12 checks passed
@thorwhalen
thorwhalen deleted the fix/crlf-doc-size-in-scanned-projects branch September 22, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant