Skip to content

Carry an EditorConfig With lib/sh So Carriers' shfmt Settings Cannot Reach the Locked Copy - #3628

Merged
ptr727 merged 3 commits into
developfrom
lib-sh-editorconfig
Oct 29, 2026
Merged

ptr727 merged 3 commits into
developfrom
lib-sh-editorconfig

Conversation

@ptr727

@ptr727 ptr727 commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Summary

The host-secrets type carries lib/sh byte-for-byte to lib/fleet/sh. A carrier whose .editorconfig sets [*.sh] indent_style = tab then fails shfmt -d on the carried copy, and cannot reformat it.

This adds lib/sh/.editorconfig, which the tree's **/* include carries beside secrets.sh. It holds one [*.sh] section that pins every key shfmt reads at the value secrets.sh is formatted with, the indent and the eight formatting switches and shell_variant = bash. It sets no root = true, so every other setting still comes from the carrier's own files. A carrier's root-level workaround section then becomes redundant at its next resync.

The issue proposed pinning only the indent. The local review found that a carrier's switch_case_indent, function_next_line, shell_variant, or minify reaches the copy the same way, so the file pins them all.

A test in tests/test_secrets_sh.py reads the file and asserts the one section and its full key set, so a deletion or a drifted value fails CI, whose unit-test job has no shfmt.

Refs #3576

Verification

  • A scratch carrier whose root .editorconfig sets [*.sh] indent_style = tab fails shfmt -d lib/fleet/sh/secrets.sh (exit 1) without the new file and passes (exit 0) with it.
  • A scratch carrier whose root [*.sh] flips every pinned key (tab, size 2, posix, and every boolean true) passes with the new file, on local shfmt 3.8.0 and on the mirror.gcr.io/mvdan/shfmt:latest image CI runs (v3.14.1). Flipped one at a time without the file, shell_variant, switch_case_indent, function_next_line, the indent, and (on 3.14 only) minify each fail.
  • The hub's own *.sh files pass shfmt -d on both versions.
  • carry.py's inventory() lists lib/sh as .editorconfig and secrets.sh, so the carry includes the dotfile.
  • The new test fails when the file gains a top-level root = true.
  • The full suite ran 3085 tests, OK (skipped=7).
  • The local strict review ran three rounds at the frontier tier. Round one raised the unpinned keys (fixed), round two the class name (fixed), and round three found nothing.

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 29, 2026 14:37
The host-secrets type carries lib/sh byte-for-byte to lib/fleet/sh. A
carrier whose .editorconfig sets [*.sh] indent_style = tab then fails
shfmt -d on that copy, and cannot reformat it. An .editorconfig inside
the tree pins [*.sh] to four spaces, and the tree's **/* include carries
it beside the scripts. It sets no root = true, so every other setting
still comes from the carrier's own files.

Closes #3576

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A carrier's [*.sh] reaches every key the closer file leaves unset, so
switch_case_indent, function_next_line, shell_variant, or minify in a
carrier still failed shfmt -d on the byte-locked copy. Each key shfmt
reads is now pinned at the value secrets.sh is formatted with.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 29, 2026 21:43
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@ptr727

ptr727 commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 29afdc0bd129ab9754ddff3701751af5f5784f43, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI 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.

🟢 Approval recommended

No active review issues are identified in the localized shfmt configuration or its regression coverage.

No open issues 🎉

What changed in this PR

This pull request makes the carried lib/sh copy independent of carrier-level shfmt configuration by adding a local EditorConfig and regression coverage.

Changes:

  • Added lib/sh/.editorconfig with all relevant shfmt settings pinned.
  • Added tests validating the required section, keys, values, and inheritance behavior.
  • Preserved unrelated EditorConfig settings from the carrier repository.
File Description
tests/​test_secrets_sh.py Verifies the carried formatting configuration remains complete and exact.
lib/​sh/​.editorconfig Pins the shell formatting settings carried alongside secrets.sh.

Review effort: Lite

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.62%. Comparing base (3172314) to head (29afdc0).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3628   +/-   ##
========================================
  Coverage    81.62%   81.62%           
========================================
  Files           26       26           
  Lines         9077     9077           
========================================
  Hits          7409     7409           
  Misses        1668     1668           
Flag Coverage Δ
python-3.13 81.62% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit c4add87 into develop Oct 29, 2026
14 checks passed
@ptr727
ptr727 deleted the lib-sh-editorconfig branch October 29, 2026 22:18
ptr727 added a commit that referenced this pull request Oct 29, 2026
… Settings Cannot Reach the Locked Copy (#3629)

Promotes the #3576 `lib/sh` EditorConfig from `develop` to `main`.

- [#3628](#3628) Carries
an EditorConfig with `lib/sh` that pins every `shfmt` setting, so a
carrier's own `[*.sh]` cannot reach the byte-locked copy.

Closes #3576

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants