منصوبے کے بارے میں

ShellCheck ایک سٹیٹک تجزیہ ٹول ہے جو bash/sh اِشیل اسکرپٹس کے لیے شائع شدہ ہے، GNU GPLv3 کے تحت۔ یہ اسکرپٹس کی اسکیننگ کرتا ہے اور انہیں چلانے کے بجائے انتباہات اور تجاویز گزارش کرتا ہے۔ اس کے stated goals میں مبتدی-syntax مسائل کی وضاحت شامل ہے جو cryptic shell errors پیدا کرتے ہیں، درمیانی سطح کے semantic مسائل جو shells کو counter-intuitive طریقے سے برتاؤ کرواتے ہیں، اور subtle caveats یا corner cases جو بعد میں otherwise working scripts کو توڑ سکتے ہیں۔ README ایک وسیع gallery دستاویز کرتا ہے detected issue categories کی: quoting problems (unquoted variables, quoted tilde expansion, literal quotes in variables, prematurely expanded traps), conditional mistakes (constant test expressions, missing spaces, quoted regex in =~, unsupported [ ] operators), frequently misused commands (globs in regex contexts, redirecting sudo, misused exec, implicit find precedence), beginner syntax errors (spaces around = in assignments, comma-separated arrays, else if), style suggestions (useless cat, backticks vs $(), redirection blocks), data and typing errors (arrays assigned to strings, printf argument count mismatches, assignments in subshells), robustness concerns (catastrophic rm, globs that could become options, find -exec shell injection), اور portability warnings shebang سے منسلک، similar to checkbashisms. Usage options درج ذیل ہیں: shellcheck.net پر scripts paste کرنا، terminal میں `shellcheck yourscript` چلانا، editor integrations (Vim via ALE/Neomake/Syntastic, Emacs via Flycheck/Flymake, Sublime via SublimeLinter, Pulsar, VSCode)، اور build یا test suites میں exit codes کے ساتھ inclusion، Makefiles اور Travis CI کے examples کے ساتھ۔ README services جیسے Travis CI، Codacy، Code Climate، Code Factor، CircleCI، GitHub Actions (Linux only)، Trunk Code Quality، اور CodeRabbit پر pre-installed availability نوٹ کرتا ہے، اور specific version pin کرنے کی سفارش کرتا ہے surprise build breaks سے بچنے کے لیے۔ Output formats میں human-readable text with or without ANSI colors, JSON, CheckStyle-compatible XML, اور GCC-compatible warnings شامل ہیں، project wiki پر integration documentation کے ساتھ۔ Installation بہت سے package managers (Cabal, Stack, apt, pacman, emerge, yum, dnf, pkg, Homebrew, MacPorts, zypper, eopkg, Chocolatey, winget, scoop, conda-forge, Snap, Nix, Flox), Docker images (koalaman/shellcheck اور shellcheck-alpine), pre-compiled binaries Linux x86_64/armv6hf/aarch64, macOS aarch64/x86_64, اور Windows x86 کے لیے، plus pre-commit hook configuration کے ذریعے_covered ہے۔ Source سے build کرنے کے لیے Haskell اور Cabal درکار ہیں، تقریباً 2GB RAM compilation کے لیے نوٹ کیا گیا ہے، اور tests `cabal test` سے چلتے ہیں۔ Issues کو environment variable, command line, individually, یا globally within a file کے ذریعے ignore کیا جا سکتا ہے۔ Contributions GitHub pull requests کے تحت GPLv3 کے لیے قبول ہیں، اور README wiki کی طرف اشارہ کرتا ہے ہر warning code کی long-form descriptions کے لیے، اور shfmt formatting کے لیے، جسے ShellCheck deliberately نہیں لگاتا۔