Code editors and AI coding tools · Researched comparison
Best Shell Script Linters in 2026
ShellCheck is the first pick for most developers. It is a free, open-source static analysis tool for Bash, sh and related shells, and it catches quoting bugs, portability problems and common mistakes. If you want formatting and parsing alongside linting, shfmt is a natural companion. If you work inside Python-based CI or prefer a lighter style checker, bashate is a reasonable alternative. All three are free and open source.
We run no ads and no affiliate links at launch. The order of a list follows our published method.
Prices are the starting prices vendors list publicly. Plans change, so confirm the current price on the vendor page before you buy.
Key takeaways
ShellCheck is free and open source, runs on Linux, macOS and Windows, and covers Bash, sh, dash and ksh.
shfmt is free and open source and focuses on formatting and parsing rather than deep semantic warnings.
bashate is free and open source and checks shell style, often used in OpenStack-style CI pipelines.
None of these tools send your scripts to a remote service, so source code stays on your machine.
Tool
Best for
Standout feature
Listed starting price
Free plan or trial
1 ShellCheck
Developers who want broad, semantic warnings for Bash and sh
Large warning set
Free (open source)
Free plan
2 shfmt
Developers who want shell formatting and parsing with optional lint checks
Fast formatter and parser
Free (open source)
Free plan
3 bashate
Teams that want a lightweight shell style checker in Python CI
Simple style rules
Free (open source)
Free plan
4 shellharden
Developers who want to rewrite scripts toward safer quoting
Rewrites unsafe quoting
Free (open source)
Free plan
5 checkbashisms
Maintainers who need to verify scripts are POSIX sh compatible
Focused on POSIX portability
Free (open source)
Free plan
How we picked
We picked tools that are real, currently maintained and genuinely perform shell linting, formatting or portability checks. Criteria were fit for the job, supported platforms and shells, licence and price, whether analysis runs locally, and main limits such as narrow rule sets. Sources are vendor pages, project documentation and public repositories. Prices and plan details can change, so confirm on the vendor site before you commit.
01
ShellCheck
Best for: Developers who want broad, semantic warnings for Bash and sh
ShellCheck parses shell scripts and reports issues such as unquoted variables, incorrect test syntax, portability problems between sh and Bash, and common pitfalls with arrays and globs. It supports sh, Bash, dash and ksh, and you can set the target shell with a directive or a command-line flag. It runs as a standalone binary on Linux, macOS and Windows, and it is packaged in most distributions.
The project is open source under GPLv3. It integrates with many editors and CI systems, and it can output several formats including plain text, JSON and checkstyle XML. The main limit is that some warnings are stylistic or context-dependent, so teams often suppress specific codes with inline directives. It does not format code. Teams that want both linting and formatting usually pair it with shfmt.
Pros
Large warning set
editor and CI integrations
Cons
Can be noisy on intentional patterns
no auto-fix for every warning
Price: Free (open source), as listed by the vendor (ShellCheck website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: can be noisy on intentional patterns.
Verdict. A sensible pick for developers who want broad, semantic warnings for Bash and sh.
02
shfmt
Best for: Developers who want shell formatting and parsing with optional lint checks
shfmt is part of the mvdan/sh project. It formats shell scripts and can also parse them, and it supports POSIX sh, Bash, mksh and zsh to varying degrees. You can run it in check mode to fail CI when formatting drifts, and it offers options for indentation, binary operators and redirect placement. It is written in Go and ships as a single binary for Linux, macOS and Windows.
The project is open source under BSD-3-Clause. shfmt is not a full semantic linter, so it will not catch every quoting or portability bug that ShellCheck reports. Many teams run shfmt for formatting and ShellCheck for warnings. If your only goal is catching logic and portability errors, shfmt alone is not enough.
Pros
Fast formatter and parser
editor and CI friendly
Cons
Fewer semantic warnings than ShellCheck
style opinions may differ from your team
Price: Free (open source), as listed by the vendor (shfmt website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: fewer semantic warnings than ShellCheck.
Verdict. A sensible pick for developers who want shell formatting and parsing with optional lint checks.
03
bashate
Best for: Teams that want a lightweight shell style checker in Python CI
bashate is a style checker for shell scripts, maintained under the OpenStack project. It checks rules such as indentation, line length, trailing whitespace and certain command patterns. It is written in Python and installs with pip, which makes it easy to add to Python-centric CI pipelines. It is open source under Apache-2.0.
bashate is narrower than ShellCheck. It focuses on style and simple patterns rather than deep semantic analysis of variable expansion or portability. It is a good fit if you already run OpenStack-style tooling or want a small, predictable rule set. For most general shell projects, ShellCheck covers more ground, and bashate is best treated as a complement rather than a replacement.
Pros
Simple style rules
easy to add to Python-based CI
Cons
Narrow rule set
not a deep semantic analyzer
Price: Free (open source), as listed by the vendor (bashate website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: narrow rule set.
Verdict. A sensible pick for teams that want a lightweight shell style checker in Python CI.
04
shellharden
Best for: Developers who want to rewrite scripts toward safer quoting
shellharden is a tool that rewrites shell scripts to use safer quoting and expansion. It can run in check mode to report changes, or in rewrite mode to apply them. It targets Bash and sh and is written in Rust, shipping as a binary for Linux, macOS and Windows. The project is open source under MPL-2.0.
Its scope is narrower than ShellCheck. It does not try to cover every lint rule; it concentrates on quoting and word-splitting hazards. That focus makes it useful as a companion to ShellCheck, especially when you want automatic rewrites rather than warnings. If you need broad coverage of test syntax, portability and array pitfalls, ShellCheck remains the broader tool.
Pros
Rewrites unsafe quoting
focused on correctness
Cons
Narrow scope
not a general style linter
Price: Free (open source), as listed by the vendor (shellharden website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: narrow scope.
Verdict. A sensible pick for developers who want to rewrite scripts toward safer quoting.
05
checkbashisms
Best for: Maintainers who need to verify scripts are POSIX sh compatible
checkbashisms is a script that reports Bash-specific constructs in scripts that are meant to be POSIX sh compatible. It ships as part of the Debian devscripts package and is available in many distributions. It is open source. It is useful when you maintain /bin/sh scripts that must run on dash, busybox or other minimal shells.
It does not replace ShellCheck. It has a single purpose: flag non-POSIX constructs. It will not check quoting, test syntax or style. Use it when portability to POSIX sh is the specific requirement, and pair it with ShellCheck for broader warnings. It runs on Linux and other Unix-like systems where devscripts is packaged.
Pros
Focused on POSIX portability
part of Debian devscripts
Cons
Narrow purpose
not a general linter
Price: Free (open source), as listed by the vendor (checkbashisms website). Confirm the current plan price before you buy.
Skip it if this limit matters to you: narrow purpose.
Verdict. A sensible pick for maintainers who need to verify scripts are POSIX sh compatible.
Who should use what
If you write Bash or sh daily and want broad warnings, start with ShellCheck and add editor integration. If your team argues about formatting, add shfmt in check mode to CI. If you maintain POSIX sh scripts for dash or busybox, run checkbashisms alongside ShellCheck. If your pipeline is Python-based and you want a small style checker, bashate fits.
What to check before you buy
Confirm the tool supports the shells you target, such as Bash, POSIX sh, dash, ksh or zsh.
Check that it runs locally or in CI so source code is not sent to a third party.
Review the licence and whether it fits your organization's policy.
Test the rule set on your existing scripts and plan how to suppress intentional warnings.
Verify editor and CI integrations, and pin the tool version for reproducible results.
FAQ
Is ShellCheck enough on its own?
For many projects, yes. ShellCheck covers quoting, test syntax, portability and common pitfalls. It does not format code, so teams that enforce formatting usually add shfmt. Some teams also add checkbashisms when POSIX sh compatibility is a hard requirement.
Do these linters send my scripts to a server?
The command-line tools run locally and do not send scripts to a remote service. Prefer local or CI runs for real code.
Can I run these in CI?
Yes. ShellCheck, shfmt, bashate, shellharden and checkbashisms all work in CI. shfmt has a check mode that fails when formatting drifts. ShellCheck can output JSON or checkstyle XML for CI reporting. Pin versions so results stay stable across runs.
What is the difference between a linter and a formatter?
A linter reports potential problems such as unquoted variables or non-POSIX syntax. A formatter rewrites layout such as indentation and spacing. ShellCheck is a linter. shfmt is mainly a formatter and parser. Many teams run both, since each covers a different job.
Are these tools free?
ShellCheck, shfmt, bashate, shellharden and checkbashisms are free and open source. Check each project's licence, such as GPLv3, BSD-3-Clause, Apache-2.0 or MPL-2.0, against your organization's policy.