All Projects → timonwong → Vscode Shellcheck

timonwong / Vscode Shellcheck

Licence: mit
An extension to use shellcheck linter in vscode

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Vscode Shellcheck

Graphql For Vscode
GraphQL syntax highlighting, linting, auto-complete, and more!
Stars: ✭ 265 (-25.14%)
Mutual labels:  linter, vscode
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (-26.55%)
Mutual labels:  linter, vscode
Dlint
Dlint is a tool for encouraging best coding practices and helping ensure we're writing secure Python code.
Stars: ✭ 320 (-9.6%)
Mutual labels:  linter
Chrome Vs Code
A web browser integrated in VS Code editor tabs. ☢️ experimental ☢️
Stars: ✭ 351 (-0.85%)
Mutual labels:  vscode
Rubocop Performance
An extension of RuboCop focused on code performance checks.
Stars: ✭ 340 (-3.95%)
Mutual labels:  linter
Plpgsql check
plpgsql_check is linter tool for language PL/pgSQL (native language for PostgreSQL store procedures).
Stars: ✭ 322 (-9.04%)
Mutual labels:  linter
Exakat
The Exakat Engine : smart static analysis for PHP
Stars: ✭ 346 (-2.26%)
Mutual labels:  linter
Pylint
It's not just a linter that annoys you!
Stars: ✭ 3,733 (+954.52%)
Mutual labels:  linter
Gometalinter
DEPRECATED: Use https://github.com/golangci/golangci-lint
Stars: ✭ 3,549 (+902.54%)
Mutual labels:  linter
Vscodejupyter
Jupyter for Visual Studio Code
Stars: ✭ 337 (-4.8%)
Mutual labels:  vscode
Git Cop
DEPRECATED: Use Git Lint (https://www.alchemists.io/projects/git-lint) instead.
Stars: ✭ 352 (-0.56%)
Mutual labels:  linter
Phpqa
PHPQA all-in-one Analyzer CLI tool
Stars: ✭ 336 (-5.08%)
Mutual labels:  linter
Pmd
An extensible multilanguage static code analyzer.
Stars: ✭ 3,667 (+935.88%)
Mutual labels:  linter
Openvsx
An open-source registry for VS Code extensions
Stars: ✭ 344 (-2.82%)
Mutual labels:  vscode
Reorder python imports
Rewrites source to reorder python imports
Stars: ✭ 320 (-9.6%)
Mutual labels:  linter
Detekt
Static code analysis for Kotlin
Stars: ✭ 4,169 (+1077.68%)
Mutual labels:  linter
Wpf.notifications
WPF notifications UI controls (as seen in VS Code)
Stars: ✭ 318 (-10.17%)
Mutual labels:  vscode
Themer Gui
A graphical UI for themer. Replaced by Progressive Web App at https://themer.dev.
Stars: ✭ 337 (-4.8%)
Mutual labels:  vscode
Ameba
A static code analysis tool for Crystal
Stars: ✭ 341 (-3.67%)
Mutual labels:  linter
Vscode Php Intellisense
Advanced PHP IntelliSense for Visual Studio Code 🆚💬
Stars: ✭ 358 (+1.13%)
Mutual labels:  vscode

ShellCheck for Visual Studio Code

Integrates ShellCheck into VS Code, a linter for Shell scripts.

ci Current Version Install Count

Quick start

Extension GIF

Disclaimer

vscode-shellcheck (this "extension"), requires shellcheck (the awesome static analysis tool for shell scripts) to work.

Since v0.10.0, precompiled shellcheck binaries are bundled for these platforms:

  • Linux (x86_64)
  • macOS (x86_64)
  • Windows: precompiled 32bit binary will be used on both 32bit and 64bit Windows, please note that this requires you have WoW64 enabled, althouth it's not a problem for Desktop users.

Requirements

  1. Run Install Extension command from Command Palette.
  2. Search and choose shellcheck.

Options

There are various options that can be configured by making changes to your user or workspace preferences.

Default options are:

{
    "shellcheck.enable": true,
    "shellcheck.enableQuickFix": true,
    "shellcheck.run": "onType",
    "shellcheck.executablePath": "",  // Priority: user defined > bundled shellcheck binary > "shellcheck"
    "shellcheck.exclude": [],
    "shellcheck.customArgs": [],
    "shellcheck.ignorePatterns": {
        "**/*.zsh": true,
        "**/*.zshrc": true,
        "**/zshrc": true,
        "**/*.zprofile": true,
        "**/zprofile": true,
        "**/*.zlogin": true,
        "**/zlogin": true,
        "**/*.zlogout": true,
        "**/zlogout": true,
        "**/*.zshenv": true,
        "**/zshenv": true,
        "**/*.zsh-theme": true
    },
    "shellcheck.ignoreFileSchemes": ["git", "gitfs"],
}

shellcheck.ignorePatterns

The shellcheck.ignorePatterns works exactly the same as search.exclude, read more about glob patterns here

For example:

{
    "shellcheck.ignorePatterns": {
        "**/*.zsh": true,
        "**/*.zsh*": true,
        "**/.git/*.sh": true,
        "**/folder/**/*.sh": true
    }
}

Experimental Quick Fix

In order to enable the "auto fix" feature, shellcheck v0.7.0 or better is required.

Since this feature is still in experimental, additionally, shellcheck.enableQuickFix should be true:

{
    "shellcheck.enableQuickFix": true
}

Lint onType or onSave

By default the linter will lint as you type. Alternatively, set shellcheck.run to onSave if you want to lint only when the file is saved (works best if auto-save is on).

{
    "shellcheck.run": "onType" // also: "onSave"
}

Excluding Checks

By default all shellcheck checks are performed and reported on as necessary. To globally ignore certain checks in all files, add the "SC identifiers" to shellcheck.exclude. For example, to exclude SC1017:

{
    "shellcheck.exclude": ["1017"],
}

Using Docker version of shellcheck

In order to get it work, you need a "shim" script, and then, just remember, do not try to construct command line arguments for shellcheck yourself.

Here is a simple "shim" script to get start with (See discussion: #24):

#!/bin/bash

exec docker run --rm -i -v "$PWD:/mnt:ro" koalaman/shellcheck:v0.7.0 "[email protected]"

Acknowledgements

This extension is based on hoovercj's Haskell Linter.

Contributors

LICENSE

This extension is licensed under the MIT license.

Bundled shellcheck binaries are licensed under GPLv3.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].