Skip to content

Enforce one set of line endings #970

@robwoodgate

Description

@robwoodgate

I ran into noisy whitespace-only diffs while making a small change in the test suite, and it looks like the repository does not currently define a clear line ending policy.

What I observed:

  • make format only runs poetry run ruff check . --fix from Makefile, so it does not normalize line endings
  • line endings are only handled in pre-commit via mixed-line-ending
  • .pre-commit-config.yaml does not pass an explicit --fix=lf or --fix=crlf, so the hook uses auto behaviour
  • in at least one case, pre-commit settled a Python file to CRLF, which makes the intended repo standard unclear

Why this matters:

  • small changes can produce unrelated whitespace-only diffs
  • contributors may get different results from make format vs pre-commit
  • review noise increases, especially for focused PRs

Suggested fix:

  • choose a repo-wide line ending standard explicitly, likely LF
  • enforce it in source control, ideally with .gitattributes
  • optionally also add .editorconfig so editors default to the same convention
  • make pre-commit match that policy explicitly, for example by configuring mixed-line-ending with --fix=lf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions