Repository navigation
Carry an EditorConfig With lib/sh So Carriers' shfmt Settings Cannot Reach the Locked Copy - #3628
Conversation
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]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟢 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/.editorconfigwith all relevantshfmtsettings 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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… 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)
Summary
The
host-secretstype carrieslib/shbyte-for-byte tolib/fleet/sh. A carrier whose.editorconfigsets[*.sh] indent_style = tabthen failsshfmt -don the carried copy, and cannot reformat it.This adds
lib/sh/.editorconfig, which the tree's**/*include carries besidesecrets.sh. It holds one[*.sh]section that pins every keyshfmtreads at the valuesecrets.shis formatted with, the indent and the eight formatting switches andshell_variant = bash. It sets noroot = 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, orminifyreaches the copy the same way, so the file pins them all.A test in
tests/test_secrets_sh.pyreads 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 noshfmt.Refs #3576
Verification
.editorconfigsets[*.sh] indent_style = tabfailsshfmt -d lib/fleet/sh/secrets.sh(exit 1) without the new file and passes (exit 0) with it.[*.sh]flips every pinned key (tab, size 2,posix, and every booleantrue) passes with the new file, on localshfmt3.8.0 and on themirror.gcr.io/mvdan/shfmt:latestimage 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)minifyeach fail.*.shfiles passshfmt -don both versions.carry.py'sinventory()listslib/shas.editorconfigandsecrets.sh, so the carry includes the dotfile.root = true.frontiertier. Round one raised the unpinned keys (fixed), round two the class name (fixed), and round three found nothing.🤖 Generated with Claude Code