Repository navigation
Measure scanned doc sizes with LF-normalized line endings - #28
Merged
Merged
Conversation
#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>
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.
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=lfin.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=trueis the Git for Windows default), soDocSpec.size_bytes(rawst_size) still differs by host. That size drivesmaintain's_MIN_DOC_BYTESstub check andscore's empty-doc check, so the same repo could be flagged as having a stub doc on Linux and not on Windows.Fix:
scanmeasures doc size after normalizing CRLF to LF (_content_size). Regression testtest_doc_size_ignores_crlf_line_endingswrites the same doc with LF and CRLF endings and asserts equal sizes; it fails onmain(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