Enforce LF line endings with editorconfig and gitattributes #57

Merged
Philipp merged 1 commits from chore/enforce-linux-line-endings into main 2026-01-03 21:57:35 +01:00
Owner

User description

Add .gitattributes and .editorconfig to enforce LF line endings. Update devcontainer settings.


PR Type

Enhancement


Description

  • Add .gitattributes to enforce LF line endings

  • Introduce .editorconfig with LF and formatting rules

  • Update devcontainer.json to set files.eol to "\n"

  • Fix git hooks path in .devcontainer/setup.sh


File Walkthrough

Relevant files
Configuration changes
setup.sh
Update git hooks chown path                                                           

.devcontainer/setup.sh

  • Changed git hooks chown path to absolute workspace path
+1/-1     
devcontainer.json
Enforce LF in devcontainer settings                                           

.devcontainer/devcontainer.json

  • Added "files.eol": "\n" setting
  • Ensured trailing comma after defaultFormatter
+2/-1     
.editorconfig
Add .editorconfig for LF endings                                                 

.editorconfig

  • Created file with root and LF rules
  • Set charset, indent style, and final newline
+8/-0     
.gitattributes
Add .gitattributes for LF enforcement                                       

.gitattributes

  • Created file to set text=auto and eol=lf globally
+1/-0     

### **User description** Add .gitattributes and .editorconfig to enforce LF line endings. Update devcontainer settings. ___ ### **PR Type** Enhancement ___ ### **Description** - Add .gitattributes to enforce LF line endings - Introduce .editorconfig with LF and formatting rules - Update devcontainer.json to set files.eol to "\n" - Fix git hooks path in .devcontainer/setup.sh ___ <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>setup.sh</strong><dd><code>Update git hooks chown path</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> .devcontainer/setup.sh - Changed git hooks chown path to absolute workspace path </details> </td> <td><a href="https://git.horstenkamp.eu/Screeps/screeps-deploy-action/src/branch/chore/enforce-linux-line-endings/.devcontainer/setup.sh">+1/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>devcontainer.json</strong><dd><code>Enforce LF in devcontainer settings</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> .devcontainer/devcontainer.json <ul><li>Added "files.eol": "\n" setting<br> <li> Ensured trailing comma after defaultFormatter</ul> </details> </td> <td><a href="https://git.horstenkamp.eu/Screeps/screeps-deploy-action/src/branch/chore/enforce-linux-line-endings/.devcontainer/devcontainer.json">+2/-1</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>.editorconfig</strong><dd><code>Add .editorconfig for LF endings</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> .editorconfig <ul><li>Created file with root and LF rules<br> <li> Set charset, indent style, and final newline</ul> </details> </td> <td><a href="https://git.horstenkamp.eu/Screeps/screeps-deploy-action/src/branch/chore/enforce-linux-line-endings/.editorconfig">+8/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>.gitattributes</strong><dd><code>Add .gitattributes for LF enforcement</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> .gitattributes - Created file to set text=auto and eol=lf globally </details> </td> <td><a href="https://git.horstenkamp.eu/Screeps/screeps-deploy-action/src/branch/chore/enforce-linux-line-endings/.gitattributes">+1/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></td></tr></tr></tbody></table> </details> ___
Philipp added the chore label 2026-01-03 21:56:17 +01:00
Philipp added 1 commit 2026-01-03 21:56:18 +01:00
chore: enforce linux line endings
Some checks are pending
Lint / pre-commit Linting (push) Waiting to run
9ae6ada818
Add .gitattributes and .editorconfig to enforce LF line endings. Update devcontainer settings.
Philipp force-pushed chore/enforce-linux-line-endings from 9ae6ada818 to 4316906497 2026-01-03 21:56:32 +01:00 Compare
Philipp scheduled this pull request to auto merge when all checks succeed 2026-01-03 21:56:38 +01:00
AutoReview changed title from chore: enforce linux line endings to Enforce LF line endings with editorconfig and gitattributes 2026-01-03 21:56:43 +01:00
Member

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵
🧪 No relevant tests
🔒 No security concerns identified
 Recommended focus areas for review

Hardcoded path

The git hooks path is hardcoded to /workspaces/screeps-deploy-action/.git/hooks, which may break if the workspace folder name or mount point changes. Consider using a dynamic path (e.g., $(pwd)/.git/hooks or an environment variable) to improve portability.

sudo chown -R node:node /workspaces/screeps-deploy-action/.git/hooks
## PR Reviewer Guide 🔍 Here are some key observations to aid the review process: <table> <tr><td>⏱️&nbsp;<strong>Estimated effort to review</strong>: 2 🔵🔵⚪⚪⚪</td></tr> <tr><td>🧪&nbsp;<strong>No relevant tests</strong></td></tr> <tr><td>🔒&nbsp;<strong>No security concerns identified</strong></td></tr> <tr><td>⚡&nbsp;<strong>Recommended focus areas for review</strong><br><br> <details><summary><a href='https://git.horstenkamp.eu/Screeps/screeps-deploy-action/src/branch/chore/enforce-linux-line-endings/.devcontainer/setup.sh#L8-L8'><strong>Hardcoded path</strong></a> The git hooks path is hardcoded to `/workspaces/screeps-deploy-action/.git/hooks`, which may break if the workspace folder name or mount point changes. Consider using a dynamic path (e.g., `$(pwd)/.git/hooks` or an environment variable) to improve portability. </summary> ```shell sudo chown -R node:node /workspaces/screeps-deploy-action/.git/hooks ``` </details> </td></tr> </table>
Philipp scheduled this pull request to auto merge when all checks succeed 2026-01-03 21:57:05 +01:00
Member

PR Code Suggestions

## PR Code Suggestions ✨ <!-- -->
Philipp merged commit a14206d32c into main 2026-01-03 21:57:34 +01:00
Philipp deleted branch chore/enforce-linux-line-endings 2026-01-03 21:57:37 +01:00
Sign in to join this conversation.