diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..3b2ca40c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +# Editor defaults for every file in this repository, including gitignored +# working files that git never sees. LF only on every OS: .gitattributes +# enforces it at commit time, this file at edit time. +# +# Trailing whitespace is trimmed in Markdown too: write a hard line break as +# a trailing backslash, not two trailing spaces (mdformat converts the +# two-space form to the backslash form anyway). +# +# This is the floor. Add sections for particular file types (indent rules, +# for example), but do not override the [*] keys. +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 461bb5e6..706b3d67 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,6 +50,13 @@ jobs: with: submodules: true + - name: No CRLF line endings in tracked files + run: | + if git ls-files --eol | grep -E '^i/(crlf|mixed)' | grep -v 'attr/-text'; then + echo "CRLF found in the files above; .gitattributes requires LF." + exit 1 + fi + - name: Install uv uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 with: diff --git a/pyproject.toml b/pyproject.toml index 58aaae67..a345439b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -197,4 +197,4 @@ combine-as-imports = true quote-style = "double" indent-style = "space" skip-magic-trailing-comma = false -line-ending = "auto" +line-ending = "lf"