# NOTE: later rules win, so the general default comes first and the overrides follow.

# Repository default: normalise to LF in the blob, check out per platform.
* text=auto

# Windows-only scripts keep CRLF on checkout.
*.ps1 text eol=crlf
*.bat text eol=crlf
*.cmd text eol=crlf

# Shell scripts must keep LF even on Windows or they will not run.
*.sh text eol=lf

# Engine-output fixtures must be preserved byte-for-byte.
#
# pip and uv emit CRLF on Windows. Normalising those to LF in the blob would test the adapter
# parsers against line endings that never occur in production — a parser mishandling a trailing
# \r would pass CI and fail on every real Windows machine. docs/TESTING.md §1 makes adapter
# parsing the thing that must never regress, so: no normalisation.
#
# `-text` is what buys that. `-diff` does NOT: it only suppresses the textual diff, and it used
# to be set here too, which meant the weekly drift job — whose entire job is to show you which
# engine bytes moved — could report nothing but "Binary files differ". Byte-exactness and a
# readable diff are not in tension, so keep the first and drop the second.
crates/pipdock-core/tests/fixtures/**/*.txt -text

# The JSON sidecars are ours, not the engines'. They are ordinary text and must stay diffable:
# meta.json is the contract the drift job gates on, so its diff has to be legible.
crates/pipdock-core/tests/fixtures/**/*.json text eol=crlf

# ...except under health/, where the JSON *is* the tool's output rather than a sidecar of ours.
# deptry and ruff write it, so it gets the same byte-for-byte treatment the engine .txt captures
# get — the rule above would have rewritten a captured document's line endings and quietly made it
# something no tool ever emitted. Later rules win, which is what lets this sit as an exception.
crates/pipdock-core/tests/fixtures/health/** -text
