Files
wordcraft/.gitattributes
T
batistalucasv ed66198574 .gitattributes: normalise text on add so CRLF cannot be committed again (#6543)
`cargo fmt --check` passes on CRLF (verified: exit 0, empty output), so the gate cannot see a commit that rewrites line endings. `#6537` did exactly that: 50 files, 35,102 lines, all CRLF, while declaring a one-line test change.

## Change

Adds the normalisation the repository lacks — `.gitattributes` only pins `craft-i18n.rev` today:

```
# Text lives in the repository with LF. A Windows checkout once committed 50 files with CRLF
# (#6537) and `cargo fmt --check` still passed, so the gate could not see it. Normalise on add.
* text=auto

craft-i18n.rev text eol=lf
```

`craft-i18n.rev` stays last so the specific rule still wins.

## Dependency

The repair landed first: #6541 merged as `eae8363e`, and `git grep -lI $'\r'` on that head finds **0** text files. This branch merges that `main` in `01617884`, so the rule now applies to a tree that is already LF.

`text=auto` is not an absolute enforcement gate. It normalises text on add, and it does not rewrite a blob already stored with CRLF: plain `git add` on such a file leaves `git ls-files --eol` at `i/mixed`, and only `git add --renormalize` rewrites it to `i/lf`. That is why the repair had to land first, and why this is a guard for future commits, not a fix for the past.

## Why it is safe

- Every text file in `main` is already LF (`git grep -lI $'\r'` = 0).
- No `.bat`/`.cmd` or CRLF fixture exists; the `.ps1` files under `packaging/windows/` are already LF in the repository.
- `cargo fmt --check` clean and `cargo test -p wordcraft-engine --lib` 1460 passed, unchanged.

## Why two PRs

#6541 was the repair; this is the guard, and it is a repository policy change rather than part of the fix, so it is separate and optional. If a repo-wide rule is more than you want, the narrower form is one pattern per line:

```
*.rs text eol=lf
*.toml text eol=lf
*.md text eol=lf
*.properties text eol=lf
```

Thanks for the syntax correction: the single-line fallback I wrote earlier was not valid attribute syntax.

@FredApps — the dependency is settled and this branch is on the new `main`. Ready for approval when you have a moment.
2026-11-15 12:11:56 +01:00

5 lines
228 B
Plaintext

# Text lives in the repository with LF. A Windows checkout once committed 50 files with CRLF
# (#6537) and `cargo fmt --check` still passed, so the gate could not see it. Normalise on add.
* text=auto
craft-i18n.rev text eol=lf