Chuyển đến nội dung
Skillpedia
Kiểm thử41k · #6785

shellcheck-configuration

Skill này làm gì

Hướng dẫn này chỉ bạn cách dùng ShellCheck để tìm lỗi và cải thiện chất lượng mã script. Công cụ giúp script của bạn hoạt động tốt trong nhiều môi trường khác nhau.

Khi nào nên dùng

  • ✓Khi bạn thiết lập công cụ để tự động kiểm tra script.
  • ✓Khi muốn sửa các vấn đề trong một script có sẵn.
  • ✓Để hiểu các cảnh báo và lỗi mà ShellCheck hiển thị.

Liên kết skill

https://github.com/wshobson/agents/blob/main/plugins/shell-scripting/skills/shellcheck-configuration/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/wshobson/agents/blob/main/plugins/shell-scripting/skills/shellcheck-configuration/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm sao để thiết lập ShellCheck kiểm tra script của tôi trước khi tôi lưu lên kho mã?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

ShellCheck phân tích mã script mà không cần chạy nó, tìm những mẫu thường gây ra lỗi. Công cụ sẽ cảnh báo để bạn sửa các vấn đề đó.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

ShellCheck Configuration and Static Analysis

Comprehensive guidance for configuring and using ShellCheck to improve shell script quality, catch common pitfalls, and enforce best practices through static code analysis.

When to Use This Skill

  • Setting up linting for shell scripts in CI/CD pipelines
  • Analyzing existing shell scripts for issues
  • Understanding ShellCheck error codes and warnings
  • Configuring ShellCheck for specific project requirements
  • Integrating ShellCheck into development workflows
  • Suppressing false positives and configuring rule sets
  • Enforcing consistent code quality standards
  • Migrating scripts to meet quality gates

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

  1. Run ShellCheck in CI/CD - Catch issues before merging
  2. Configure for your target shell - Don't analyze bash as sh
  3. Document exclusions - Explain why violations are suppressed
  4. Address violations - Don't just disable warnings
  5. Enable strict mode - Use --enable=all with careful exclusions
  6. Update regularly - Keep ShellCheck current for new checks
  7. Use pre-commit hooks - Catch issues locally before pushing
  8. Integrate with editors - Get real-time feedback during development
Câu hỏi thường gặp

“Linting” là gì?

Linting là quá trình phân tích mã để tìm lỗi về cách viết, lỗi tiềm ẩn và các vấn đề khác trước khi chạy chương trình.

Vì sao cần cấu hình ShellCheck đúng với shell của mình?

Mỗi shell (như bash hoặc sh) có quy tắc hơi khác nhau. Cấu hình đúng giúp ShellCheck kiểm tra script theo quy tắc của shell bạn dùng.

“Suppress false positives” nghĩa là gì?

Đôi khi ShellCheck cảnh báo về điều thực ra không phải vấn đề trong trường hợp của bạn. “Bỏ qua” nghĩa là bảo ShellCheck không báo cảnh báo đó nữa, nhưng nên ghi rõ lý do.

Chi tiết

Mô tả gốc của tác giả

Master ShellCheck static analysis configuration and usage for shell script quality. Use when setting up linting infrastructure, fixing code issues, or ensuring script portability.

repo: wshobson/agents

Độ phổ biến

Sao GitHub
41k
Vị trí xếp hạng
#6785
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự