# Line endings, pinned where they are load-bearing.
#
# Git normalises line endings on checkout — `core.autocrlf` is true by default
# on Windows — so without this a file's bytes on disk depend on whose machine
# it was checked out on. That is invisible right up until something parses the
# file rather than reads it.
#
# Two things here do:
#
#   * NSIS renders the licence it is given in a rich edit control, and bare LF
#     comes out as one unbroken paragraph. build/license.txt must be CRLF.
#   * scripts/gen_legal.mjs --check regenerates the legal documents and compares
#     them with what is committed. It compares text rather than bytes now, but
#     the files still have to arrive intact.
#
# The generated legal files are also marked so `git diff` on them is legible;
# they are regenerated wholesale by `npm run legal`, never hand-edited.

# Sensible default: normalise in the repository, let git decide on checkout.
* text=auto

# Generated documents — LF everywhere, including Windows.
legal/*.md              text eol=lf linguist-generated=true
krypt/legal_documents.json text eol=lf linguist-generated=true

# The Windows installer's licence. CRLF everywhere, including macOS and Linux,
# because it is built into an installer that runs on Windows wherever it was
# packaged.
build/license.txt       text eol=crlf linguist-generated=true

# The macOS DMG's copy of the same text. LF, because nothing on that path wants
# CRLF and a stray carriage return shows up in the licence panel.
build/license_en.txt    text eol=lf linguist-generated=true

# Python, TypeScript and shell keep LF regardless of platform.
*.py    text eol=lf
*.ts    text eol=lf
*.tsx   text eol=lf
*.mjs   text eol=lf
*.sh    text eol=lf

# Windows-only scripts that cmd.exe reads.
*.bat   text eol=crlf
*.cmd   text eol=crlf
*.nsh   text eol=crlf

# Binary, so git never touches them.
*.png   binary
*.ico   binary
*.icns  binary
*.woff2 binary
*.exe   binary
*.dll   binary
