shfmt
« Back to VersTracker
Description:
Autoformat shell script source code
Type: Formula  |  Tracked Since: Dec 28, 2025
Links: Homepage  |  formulae.brew.sh
Category: Developer tools
Tags: shell formatter bash dev-tools linting
Install: brew install shfmt
About:
Shfmt is a command-line tool that formats shell script source code to ensure consistent styling and readability. It parses shell scripts and reformats them according to a specified style, such as Google, POSIX, or a custom configuration. This tool helps maintain clean, professional codebases and integrates easily into CI/CD pipelines and pre-commit hooks.
Key Features:
  • Supports multiple shell dialects (bash, mksh, zsh, POSIX)
  • Enforces consistent formatting with predefined or custom styles
  • Integrates with editors like Vim, VS Code, and Emacs
  • Fast and efficient, written in Go
  • Can simplify and fix shell scripts
Use Cases:
  • Standardizing code style across team projects
  • Automating formatting in CI/CD pipelines
  • Cleaning up legacy or minified shell scripts
Alternatives:
  • shellcheck – Focuses on static analysis and linting for errors, whereas shfmt is purely a code formatter.
  • beautysh – A Python-based formatter, while shfmt is a faster, Go-based tool with stricter style adherence.
Version History
Detected Version Rev Change Commit
Sep 11, 2025 5:06am 0 VERSION_BUMP 4b692dc6