---
name: shfmt
description: "Use when adopting shfmt to assess this standard: Format shell scripts consistently"
---

# Apply shfmt

Select a shell dialect and indentation convention. Compare tracked scripts with formatter output in CI so formatting changes stay reviewable.

## Procedure

1. Inspect the repository configuration and identify the files or targets covered by shfmt.
2. Use shfmt in this repository to meet this standard: Format shell scripts consistently. Select a shell dialect and indentation convention. Compare tracked scripts with formatter output in CI so formatting changes stay reviewable. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.
3. Record the tool version, configuration, scope and findings. Explain any checks that could not run.
4. Use the same invocation after changes and compare the evidence against the baseline.

Refer to [the upstream documentation](https://github.com/mvdan/sh) for configuration and prerequisites.

## Optional Seikika installation

Package: [shell (Seikika kit)](https://github.com/seikika/seikika/tree/89eb0a2fcd2ffe67151df43f2a062ebc8a1e497c/packages/shell).

Add github:seikika/seikika/packages/shell@89eb0a2fcd2ffe67151df43f2a062ebc8a1e497c to the include list in .seikika/seikika.yaml. Copy check-shell.py from the pinned package into tools/ and set the command parameter to invoke it on your shell script paths. Run seikika install .seikika from the checkout root.
