Skip to content

Enforce LF line endings for .devcontainer/.bashrc#2480

Merged
jjmata merged 2 commits into
we-promise:mainfrom
jestinjoshi:fix/devcontainer-bashrc-crlf
Jun 24, 2026
Merged

Enforce LF line endings for .devcontainer/.bashrc#2480
jjmata merged 2 commits into
we-promise:mainfrom
jestinjoshi:fix/devcontainer-bashrc-crlf

Conversation

@jestinjoshi

@jestinjoshi jestinjoshi commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

Adds a .gitattributes rule to enforce LF line endings on .devcontainer/.bashrc.

Why

On Windows, .devcontainer/.bashrc was checked out with CRLF line endings because no .gitattributes rule covered it. Inside the dev container, bash then fails to load it:

/root/.bashrc: line 2: $'\r': command not found
/root/.bashrc: line 7: syntax error near unexpected token `$'{\r''

This breaks the custom shell prompt (the git_branch/git_status_marker helpers) for anyone developing on Windows via the dev container.

Fix

.devcontainer/.bashrc text eol=lf

This follows the existing convention in the same file (bin/*, *.sh, *.rb are already pinned to eol=lf for the same reason).

Safety / impact

  • The committed blob is already LF, so this changes no file content — the PR is a single line in .gitattributes.
  • macOS/Linux contributors: no change (already LF).
  • Windows contributors: the file is silently re-checked-out as LF, which is correct since .bashrc is consumed only by Linux bash inside the container.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated project configuration to enforce consistent line endings across development files.

On Windows, .devcontainer/.bashrc was checked out with CRLF line
endings (no .gitattributes rule covered it), causing the dev
container's bash to fail loading it with `$'\r': command not found`
errors and breaking the prompt's git-branch helper.

Add a `.devcontainer/.bashrc text eol=lf` rule so the file stays LF
on all platforms, following the existing convention for bin/*, *.sh
and *.rb.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

A single line is added to .gitattributes to enforce LF line endings on .devcontainer/.bashrc, consistent with the existing text eol=lf rules applied to other scripts and Ruby files.

Changes

Line ending normalization

Layer / File(s) Summary
LF rule for .devcontainer/.bashrc
.gitattributes
Adds a text eol=lf entry for .devcontainer/.bashrc to normalize its line endings to LF.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~1 minute

Poem

A bashrc file sat in its devcontainer nest,
Its line endings wandered — that wasn't the best.
One hop, one rule, one line in the file,
Now LF keeps order with bunny-eared style! 🐇
Git attributes rejoice down the mile!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: enforcing LF line endings for a specific bash configuration file in the dev container.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@superagent-security

Copy link
Copy Markdown

Superagent didn't find any vulnerabilities or security issues in this PR.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.gitattributes:
- Line 18: The gitattributes rule correctly targets .devcontainer/.bashrc, but
docker-compose.yml has a broken mount configuration that tries to mount
./.bashrc (which does not exist at the repository root) into the container. To
fix this, update the mount configuration in docker-compose.yml to reference
.devcontainer/.bashrc instead of ./.bashrc, or alternatively create and commit a
.bashrc file at the repository root for the container to use. Choose whichever
approach aligns with your project's intended structure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 673379c1-5b15-4a89-9449-9cc6e3221c64

📥 Commits

Reviewing files that changed from the base of the PR and between fdcd0c7 and f1b3030.

📒 Files selected for processing (1)
  • .gitattributes

Comment thread .gitattributes

jjmata commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Good catch and a clean fix — the .bashrc extension-less filename falls through all the existing wildcard rules (bin/*, *.sh, *.rb), so an explicit entry is the right approach.

One thing worth considering: .devcontainer/ may grow other shell-executed files over time (setup scripts, entrypoints, etc.). A slightly broader rule like

.devcontainer/* text eol=lf

would cover the whole directory without needing per-file entries. The current single-file rule is perfectly fine for now — just flagging the option in case you'd prefer to be more future-proof without adding a bigger change.

Otherwise this is correct, minimal, and consistent with the existing conventions in .gitattributes. 👍


Generated by Claude Code

@jjmata jjmata added this to the v0.7.2 milestone Jun 24, 2026
@jjmata jjmata merged commit b8e7fe1 into we-promise:main Jun 24, 2026
11 checks passed
YumTaha added a commit to YumTaha/sure that referenced this pull request Jun 24, 2026
chore: sync upstream — enforce LF for .devcontainer/.bashrc (we-promise#2480)
YumTaha added a commit to YumTaha/sure that referenced this pull request Jun 24, 2026
Enforce LF line endings for .devcontainer/.bashrc (we-promise#2480)
@jestinjoshi jestinjoshi deleted the fix/devcontainer-bashrc-crlf branch June 24, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants