Skip to content

Instantly share code, notes, and snippets.

@rchl
Last active June 1, 2021 04:24
Show Gist options
  • Save rchl/1077151a7339b734c1678fc626b123a2 to your computer and use it in GitHub Desktop.
Save rchl/1077151a7339b734c1678fc626b123a2 to your computer and use it in GitHub Desktop.
Configure sheelcheck and flake8 with diagnostic-languageserver for Sublime LSP
{
"clients": {
"diagnostic-ls": {
"enabled": true,
"command": [
"diagnostic-languageserver",
"--stdio"
],
"selector": "source.shell, source.python",
"initializationOptions": {
"linters": {
"shellcheck": {
"command": "shellcheck",
"debounce": 100,
"args": [
"--format=json",
"-"
],
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "shellcheck",
"formatLines": 1,
"parseJson": {
"line": "line",
"column": "column",
"endLine": "endLine",
"endColumn": "endColumn",
"security": "level",
"message": "\\${message} [\\${code}]",
},
"securities": {
"error": "error",
"warning": "warning",
"note": "info",
},
},
"flake8": {
"command": "flake8",
"debounce": 100,
"args": [
"--format",
"%(row)d,%(col)d,%(code).1s,%(text)s [%(code)s]",
"-"
],
"sourceName": "flake8",
"formatLines": 1,
"formatPattern": [
"(\\d+),(\\d+),()([A-Z]),(.*)",
{
"line": 1,
"column": 2,
"security": 3, // Match a zero-length group so everything can be classified as a Warning rather than Error
"message": 5,
}
],
"securities": {
"": "warning",
},
},
},
"formatters": {},
"filetypes": {
"shellscript": "shellcheck",
"python": "flake8",
},
},
},
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment