-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitattributes
More file actions
55 lines (50 loc) · 3.1 KB
/
Copy path.gitattributes
File metadata and controls
55 lines (50 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Shell scripts must keep LF endings even when checked out on Windows: a CRLF
# shebang line makes the kernel look for an interpreter named "bash\r", and the
# error it produces ("bad interpreter: No such file or directory") points at
# the interpreter rather than at the line ending. scripts/bootstrap.sh is
# authored on Windows here and run on Linux, so this is not hypothetical.
*.sh text eol=lf
# Same reasoning for anything a Linux runner executes or parses strictly.
*.yml text eol=lf
*.yaml text eol=lf
# scripts/fonts.conf is HASHED into the canonical environment fingerprint
# (testkit/evidence.py), so its bytes are a gated value rather than just
# configuration. Authored on Windows it got CRLF, and the recorded digest
# 924510e8... was then unreproducible on any Linux checkout, which computes
# 84d4357a... -- so the canonical reference was invalid on CI and on a fresh
# clone, the two places it has to work. Anything whose bytes reach a fingerprint
# must have exactly one spelling.
*.conf text eol=lf
# JSON artifacts in this repository are not merely parsed, they are HASHED AS
# FILES, so their bytes are a pinned value in exactly the way fonts.conf's are.
# A Windows checkout with the default core.autocrlf materialised CRLF and the
# pins stopped matching: testkit/corpus_expansion.json is pinned at
# 7a2f15d6... and hashed ad3d2624... on the host, failing three tests in
# test_expansion_policy while the Linux container passed. Same content,
# different bytes per platform, which is the one thing a byte pin cannot
# tolerate.
#
# The rule is every *.json rather than a path, for two reasons. It is not one
# file: `expansion_policy._sha256` pins testkit/corpus_expansion.json,
# `gdocs_oracle._manifest_identity` pins testkit/corpus_manifest.json by "exact
# manifest bytes" (gdocs_quality_policy.json records cc4dd4c1...), and
# `livepass_verify._read_json` hashes the raw bytes of whatever evidence it
# grades, which is how testkit/livepass_predictions.json pins its baselines in
# docs/evidence/*.json. And a path-scoped rule does not reach a subdirectory --
# `testkit/*.json` would silently miss testkit/golden/pdfium/*.json, the same
# trap the fixtures_expansion note below records. A JSON file has no reason to
# want CRLF, so pinning the whole class removes the bug rather than this
# instance of it.
*.json text eol=lf
# The frozen corpus fixtures are byte-exact inputs pinned by SHA-256. Any line
# ending translation would change their hashes and make every gate run fail on a
# corpus identity check -- which is precisely the check they exist to satisfy.
testkit/fixtures/*.pdf binary
# The expansion corpus is pinned exactly the same way and needs exactly the same
# protection. Without this line `git check-attr` reports `diff: astextplain` and
# no `text: unset` for these files, so a Windows checkout with autocrlf would
# translate them on the way in and every sha256 in corpus_expansion.json would
# stop matching its own bytes. The rule above is path-scoped and does not reach
# a sibling directory, which is easy to miss precisely because the fixtures it
# does cover keep working.
testkit/fixtures_expansion/*.pdf binary