Skip to content

feat(formatting): Add shfmt#47

Merged
RasmusRendal merged 1 commit into
mainfrom
RasmusRendal/shfmt
Jul 23, 2026
Merged

feat(formatting): Add shfmt#47
RasmusRendal merged 1 commit into
mainfrom
RasmusRendal/shfmt

Conversation

@RasmusRendal

Copy link
Copy Markdown
Contributor

Upstreamed from another Famedly repository, so you know these formatter options are popular.

Upstreamed from another Famedly repository, so you know these formatter
options are popular.
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Developer tooling only; no runtime, auth, or data-path changes beyond auto-formatting shell files on commit.

Overview
Adds shfmt to the shared treefmt setup so shell scripts are formatted alongside Nix and Rust.

nix/general/formatting.nix enables programs.shfmt with tab indentation (indent_size = 0) and wires the formatter into treefmt; the generated treefmt.toml runs shfmt on *.sh, *.bash, *.envrc, and *.envrc.* with -w -i 0 -s.

Reviewed by Cursor Bugbot for commit 6651153. Bugbot is set up for automated code reviews on this repo. Configure here.

@tlater-famedly tlater-famedly 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.

Yes.

@RasmusRendal
RasmusRendal merged commit 6651153 into main Jul 23, 2026
3 checks passed
@RasmusRendal
RasmusRendal deleted the RasmusRendal/shfmt branch July 23, 2026 13:45

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.

Reviewed by Cursor Bugbot for commit 6651153. Configure here.

# Setting the indent_size to 0 uses tabs for indentation
indent_size = 0;
};
settings.formatter.shfmt.command = "shfmt";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing simplify in Nix config

Medium Severity

Issue: treefmt.toml enables shfmt -s, but programs.shfmt only sets indent_size and never enables simplify (or equivalent settings.formatter.shfmt.options). Since treefmt.toml is generated from Nix via filegen, the next apply will drop -s or fail the prek filegen check.

Fix: Enable simplify in the Nix source of truth (e.g. programs.shfmt.simplify = true, or append "-s" the same way nixfmt sets "--strict"), then regenerate treefmt.toml.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6651153. Configure here.

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