Skip to content

Carry an Indent Setting With lib/sh So Tab-Indented Carriers Pass shfmt #3576

Closed

Description

@ptr727

Summary

The lib/sh tree carried to lib/fleet/sh for the host-secrets type indents with four spaces, from the hub's [*] default. A carrier whose .editorconfig sets [*.sh] indent_style = tab then fails shfmt -d on the carried copy, and it cannot reformat the copy, since verbatim-tree fidelity byte-locks it. Nothing in spec/files.json, spec/project-types.json (host-secrets), STANDUP.md, or RESYNC.md tells a carrier this, so each one finds out when its shell format gate fails.

Reproduction

In a scratch repository:

printf 'root = true\n[*]\nindent_style = space\nindent_size = 4\n[*.sh]\nindent_style = tab\n' >.editorconfig
mkdir -p lib/fleet/sh && cp <hub>/lib/sh/secrets.sh lib/fleet/sh/
shfmt -d lib/fleet/sh/secrets.sh   # exits 1 and reindents every block

Carrier-Side Fix Used

A path-scoped section after [*.sh], which shfmt honors:

[lib/fleet/**.sh]
indent_style = space
indent_size = 4

Ask

Choose where the hub states this, for example one of these:

  • A host-secrets carry note in STANDUP.md and RESYNC.md, and an AUDIT.md intent check.
  • An .editorconfig carried inside lib/sh itself, holding [*.sh] with indent_style = space and indent_size = 4. In the scratch repository above, adding that file at lib/fleet/sh/.editorconfig turns shfmt -d from exit 1 to exit 0. The manifest entry's **/* include matches every path in carry.py's included(), so the file would ride the verbatim-tree carry and no carrier needs a section of its own.

The second removes the step for every carrier, so it is the recommendation.

Found while carrying lib/fleet/sh into ptr727/Blog (ptr727/Blog#561).

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions