Enforce LF line endings to fix yamllint CRLF failures on Windows#469
Enforce LF line endings to fix yamllint CRLF failures on Windows#469
Conversation
- Add .gitattributes to enforce LF line endings globally and explicitly for YAML files - Update mixed-line-ending pre-commit hook with --fix=lf to auto-convert CRLF to LF Agent-Logs-Url: https://github.com/NextCommunity/NextCommunity.github.io/sessions/fc11f167-090e-4ef0-ae2b-ec48c570f076 Co-authored-by: jbampton <418747+jbampton@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Pull request overview
This PR reduces Windows-specific lint failures by standardizing line endings to LF across the repository so yamllint doesn’t fail on CRLF-checked-out YAML files.
Changes:
- Add a
.gitattributesfile to normalize text files toLFand mark common image formats as binary. - Update the existing
mixed-line-endingpre-commit hook to auto-fix line endings toLF.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.gitattributes |
Enforces LF normalization for text (explicitly for YAML) and declares common image formats as binary. |
.pre-commit-config.yaml |
Configures mixed-line-ending hook to automatically convert to LF instead of only reporting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request introduces a .gitattributes file to enforce LF line endings and updates the mixed-line-ending pre-commit hook to automatically fix line endings to LF. The review feedback suggests expanding the list of explicitly defined binary files in .gitattributes to prevent potential corruption and adding a type filter to the pre-commit hook to improve efficiency by avoiding the processing of binary files.
… to mixed-line-ending hook Agent-Logs-Url: https://github.com/NextCommunity/NextCommunity.github.io/sessions/bab1cbb7-e17e-4e51-9609-c117df8c5f91 Co-authored-by: jbampton <418747+jbampton@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a .gitattributes file to enforce LF line endings and correctly handle binary files. It also updates the .pre-commit-config.yaml to configure the mixed-line-ending hook to automatically fix line endings to LF. Feedback was provided to remove a redundant types: [text] configuration from the pre-commit hook, as this is already the default behavior.
| args: [--fix=lf] | ||
| types: [text] |
There was a problem hiding this comment.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.gitattributesto enforce LF line endingsmixed-line-endinghook with--fix=lf.gitattributes(add webp, avif, pdf, woff, woff2)types: [text]tomixed-line-endinghook