シェルスクリプト品質のためのShellCheck静的解析の設定と使用をマスター。リンティングインフラの設定、コード問題の修正、またはスクリプトの移植性の確保時に使用してください。
Detected risks:
The ShellCheck Configuration skill provides comprehensive guidance for configuring and using ShellCheck, a static analysis tool for shell scripts, to improve code quality and maintain best practices. It helps developers identify common pitfalls in shell scripts, understand error and warning codes, and implement consistent code standards across projects. By integrating ShellCheck into development workflows, users can catch potential issues early, ensure script portability, and maintain high-quality scripts in both personal and collaborative environments.
This skill covers the installation of ShellCheck on various platforms, including macOS, Ubuntu/Debian, and from source, as well as configuration through project-level `.shellcheckrc` files and environment variables. It explains how to enable or disable specific checks, target particular shell dialects, and integrate with editors, CI/CD pipelines, or pre-commit hooks. The documentation also provides practical examples for minimal POSIX-compliant settings, relaxed Bash development settings, and full CI/CD integration, illustrating how to enforce quality gates and avoid false positives.
Target users include shell script developers, DevOps engineers, and CI/CD pipeline maintainers who need reliable static analysis for Bash, sh, dash, ksh, or other POSIX-compliant shells. Typical use cases involve setting up linting in automated workflows, analyzing existing scripts for issues, customizing ShellCheck to project requirements, and ensuring that scripts meet portability and quality standards. This skill is particularly valuable for teams seeking to maintain consistent code quality, reduce runtime errors, and streamline script maintenance across diverse environments.
ShellCheck can be installed using Homebrew on macOS with 'brew install shellcheck', on Ubuntu/Debian with 'apt-get install shellcheck', or by building from source using Git and Make. Verify installation with 'shellcheck --version'.
ShellCheck supports Bash, sh, dash, ksh, and other POSIX-compliant shells. The target shell can be specified in the configuration file or via environment variables.
Yes, the skill provides examples for analyzing all shell scripts in a project using CI/CD pipelines, including setting strict modes, excluding certain warnings, and exiting on errors to enforce quality gates.
False positives can be suppressed using the '.shellcheckrc' file or command-line options to disable specific warnings or enable only certain checks. Environment variables can also customize behavior per project or user.
Some features like 'local' variables or certain conditional expressions may not be POSIX-compliant. ShellCheck provides warnings (e.g., SC3010, SC3043) to guide developers toward portable solutions.
Quick Setup:
.claude/skills/Repository
amurata/cc-tools