Skip to content

Add .gitattributes for consistent line ending handling#1063

Open
AndyBodnar wants to merge 1 commit intooss-aspen:mainfrom
AndyBodnar:fix/gitattributes-line-endings
Open

Add .gitattributes for consistent line ending handling#1063
AndyBodnar wants to merge 1 commit intooss-aspen:mainfrom
AndyBodnar:fix/gitattributes-line-endings

Conversation

@AndyBodnar
Copy link
Copy Markdown

Summary

Changes

  • Created .gitattributes with rules for:
    • Python files (*.py) - always LF
    • Shell scripts (*.sh) - always LF
    • Docker/config files - always LF
    • Batch files (*.bat, *.cmd) - always CRLF (Windows-native)
    • Binary files - no modification

Test plan

  • Verify file is correctly formatted
  • Existing contributors can verify their local line endings normalize correctly

Fixes #1062

@MoralCode
Copy link
Copy Markdown
Contributor

Hello, thanks for the PR.

Would you be able to join the CHAOSS Slack #wg-augur-8knot channel? i had some questions for you and the contributors of the other PRs for this same thing

Comment on lines +38 to +47
dockerfile: "./docker/Dockerfile*"

run-python-lint:
name: python-lint
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dciborow/[email protected]
with:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR includes changes that are from other PRs. Can you please update it so it only contains the fix you are proposing?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make your commit clean

@Sukuna0007Abhi
Copy link
Copy Markdown

Sukuna0007Abhi commented Jan 15, 2026

I think you should use a rebase for it, and I closed my pr as I said in slack @AndyBodnar

Cross-platform projects often run into issues with Git auto-converting
line endings differently on Windows vs Linux. This causes unnecessary
diffs and can break shell scripts or Dockerfiles.

This adds a .gitattributes file that:
- Normalizes line endings automatically on checkout
- Forces LF for Python, shell scripts, and Docker files
- Forces CRLF for Windows batch files
- Marks binary files to prevent corruption

Fixes the line ending inconsistencies reported in the project.
@AndyBodnar AndyBodnar force-pushed the fix/gitattributes-line-endings branch from 12e3440 to 64b25e7 Compare January 17, 2026 05:13
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 17, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AndyBodnar
Copy link
Copy Markdown
Author

Rebased the branch - it now only contains the .gitattributes file as intended. Sorry about the mess before, my branch had gotten tangled up with other upstream changes.

Single commit, single file. Ready for review whenever you get a chance.

@AndyBodnar AndyBodnar requested a review from MoralCode January 18, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add .gitattributes for defining how to handle line endings

4 participants