[FIX] Fix line endings#18
Conversation
valiyyaddin
left a comment
There was a problem hiding this comment.
Great job,continue working like this.
There was a problem hiding this comment.
Pull request overview
This pull request standardizes line endings across the project to prevent issues with shell scripts and other text files when working across different operating systems. The changes add a .gitattributes file to enforce LF line endings at the repository level and update the Dockerfile to handle any existing files with incorrect line endings.
- Added
.gitattributesfile to enforce LF line endings for shell scripts, Python files, configuration files, Docker files, and other text files - Updated
api/Dockerfileto convert CRLF to LF in the entrypoint script during build process - Marked common binary file types to prevent automatic line ending conversion
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.gitattributes |
Defines line ending rules for various file types to ensure consistent LF endings across the repository |
api/Dockerfile |
Adds sed command to convert any CRLF line endings to LF in the entrypoint script before setting permissions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,31 @@ | |||
| # Ensure shell scripts always use LF line endings | |||
| *.sh text eol=lf | |||
| docker-entrypoint.sh text eol=lf | |||
There was a problem hiding this comment.
This line is redundant as docker-entrypoint.sh is already covered by the *.sh pattern on line 2. Consider removing this duplicate entry.
| docker-entrypoint.sh text eol=lf |
| # Other text files | ||
| *.md text eol=lf | ||
| *.txt text eol=lf |
There was a problem hiding this comment.
The .gitattributes file is missing patterns for JavaScript/TypeScript files (*.js, *.jsx, *.ts, .tsx) and CSS files (.css) which are present in the web directory. Consider adding these patterns with text eol=lf to ensure consistent line endings across the entire project.
This pull request focuses on standardizing line endings across the project and ensuring proper handling of shell scripts in the Docker build process. The most important changes include the addition of a
.gitattributesfile to enforce LF line endings for relevant files and an update to the Dockerfile to convert line endings for the entrypoint script.Line ending standardization:
.gitattributesto enforce LF line endings for shell scripts, Python files, configuration files, Docker files, and other text files, while marking common binary files as binary to prevent line ending conversion.Dockerfile improvements:
api/Dockerfileto convert CRLF to LF indocker-entrypoint.shusingsed, ensuring compatibility in Unix environments before setting ownership and permissions.Closes #17