-
-
Notifications
You must be signed in to change notification settings - Fork 28
Linters
Rafał Hajdacki edited this page Nov 10, 2020
·
65 revisions
"eslint": {
"command": "./node_modules/.bin/eslint", // this will find local eslint first, if local eslint not found, it
"rootPatterns": [
".git"
],
"debounce": 100,
"args": [
"--stdin",
"--stdin-filename",
"%filepath",
"--format",
"json"
],
"sourceName": "eslint",
"parseJson": {
"errorsRoot": "[0].messages",
"line": "line",
"column": "column",
"endLine": "endLine",
"endColumn": "endColumn",
"message": "${message} [${ruleId}]",
"security": "severity"
},
"securities": {
"2": "error",
"1": "warning"
}
}
"shellcheck": {
"command": "shellcheck",
"debounce": 100,
"args": [
"--format",
"json",
"-"
],
"sourceName": "shellcheck",
"parseJson": {
"line": "line",
"column": "column",
"endLine": "endLine",
"endColumn": "endColumn",
"message": "${message} [${code}]",
"security": "level"
},
"securities": {
"error": "error",
"warning": "warning",
"info": "info",
"style": "hint"
}
}
"write-good": {
"command": "write-good",
"debounce": 100,
"args": [ "--text=%text" ],
"offsetLine": 0,
"offsetColumn": 1,
"sourceName": "write-good",
"formatLines": 1,
"formatPattern": [
"(.*)\\s+on\\s+line\\s+(\\d+)\\s+at\\s+column\\s+(\\d+)\\s*$",
{
"line": 2,
"column": 3,
"message": 1
}
]
}
"vint": {
"command": "vint",
"debounce": 100,
"args": [ "--enable-neovim", "-"],
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "vint",
"formatLines": 1,
"formatPattern": [
"[^:]+:(\\d+):(\\d+):\\s*(.*)(\\r|\\n)*$",
{
"line": 1,
"column": 2,
"message": 3
}
]
}
"languagetool": {
"command": "languagetool",
"debounce": 200,
"args": ["-"],
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "languagetool",
"formatLines": 2,
"formatPattern": [
"^\\d+?\\.\\)\\s+Line\\s+(\\d+),\\s+column\\s+(\\d+),\\s+([^\\n]+)\nMessage:\\s+(.*)(\\r|\\n)*$",
{
"line": 1,
"column": 2,
"message": [4, 3]
}
],
}
"markdownlint": {
"command": "markdownlint",
"isStderr": true,
"debounce": 100,
"args": [ "--stdin" ],
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "markdownlint",
"formatLines": 1,
"formatPattern": [
"^.*?:\\s+(\\d+):\\s+(.*)(\\r|\\n)*$",
{
"line": 1,
"column": -1,
"message": 2
}
]
}
"phpcs": {
"command": "./vendor/bin/phpcs",
"debounce": 100,
"rootPatterns": [ "composer.json", "composer.lock", "vendor", ".git" ],
"args": [ "--standard=PSR2", "--report=emacs", "-s", "-" ],
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "phpcs",
"formatLines": 1,
"formatPattern": [
"^.*:(\\d+):(\\d+):\\s+(.*)\\s+-\\s+(.*)(\\r|\\n)*$",
{
"line": 1,
"column": 2,
"message": 4,
"security": 3
}
],
"securities": {
"error": "error",
"warning": "warning"
}
}
}
"phpstan": {
"command": "./vendor/bin/phpstan",
"debounce": 100,
"rootPatterns": [ "composer.json", "composer.lock", "vendor", ".git" ],
"args": [ "analyze", "--error-format", "raw", "--no-progress", "%file" ],
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "phpstan",
"formatLines": 1,
"formatPattern": [
"^[^:]+:(\\d+):(.*)(\\r|\\n)*$",
{
"line": 1,
"message": 2
}
]
}
If you need to change the --level
setting etc., put the phpstan.neon configuration file in the project
e.g. phpstan.neon
parameters:
level: 5
# more config...
"psalm": {
"command": "./vendor/bin/psalm",
"debounce": 100,
"rootPatterns": ["composer.json", "composer.lock", "vendor", ".git"],
"args": ["--output-format=emacs", "--no-progress"],
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "psalm",
"formatLines": 1,
"formatPattern": [
"^[^:]+:(\\d):(\\d):(.*)\\s-\\s(.*)(\\r|\\n)*$",
{
"line": 1,
"column": 2,
"message": 4,
"security": 3
}
],
"securities": {
"error": "error",
"warning": "warning"
},
"requiredFiles": ["psalm.xml"]
}
psalm.xml
configuration file is required to run psalm.
Add a psalm.xml
config:
./vendor/bin/psalm --init
"mix_credo": {
"command": "mix",
"debounce": 100,
"rootPatterns": ["mix.exs"],
"args": ["credo", "suggest", "--format", "flycheck", "--read-from-stdin"],
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "mix_credo",
"formatLines": 1,
"formatPattern": [
"^[^ ]+?:([0-9]+)(:([0-9]+))?:\\s+([^ ]+):\\s+(.*)(\\r|\\n)*$",
{
"line": 1,
"column": 3,
"message": 5,
"security": 4
}
],
"securities": {
"F": "warning",
"C": "warning",
"D": "info",
"R": "info"
}
}
compile error. this only works when file on save. you can use both
['mix_credo', 'mix_credo_compile']
for filetype.
"mix_credo_compile": {
"command": "mix",
"debounce": 100,
"rootPatterns": ["mix.exs"],
"args": ["credo", "suggest", "--format", "flycheck", "--read-from-stdin"],
"offsetLine": -1,
"offsetColumn": 0,
"sourceName": "mix_credo",
"formatLines": 1,
"formatPattern": [
"^([^ ]+)\\s+\\(([^)]+)\\)\\s+([^ ]+?):([0-9]+):\\s+(.*)(\\r|\\n)*$",
{
"line": -1,
"column": -1,
"message": ["[", 2, "]: ", 3, ": ", 5],
"security": 1
}
],
"securities": {
"**": "error"
}
}
"lslint": {
"command": "lslint",
"isStdout": false,
"isStderr": true,
"debounce": 100,
"formatPattern": [
"^(.+):: \\( *(\\d+), *(\\d+)\\): (.+)(\\r|\\n)*$",
{ "column": 3, "line": 2, "message": [4], "security": 1 }
],
"securities": { "ERROR": "error", "WARN": "warning" },
"sourceName": "lslint"
}
"stylelint": {
"command": "./node_modules/.bin/stylelint",
"rootPatterns": [
".git"
],
"debounce": 100,
"args": [
"--formatter",
"json",
"--stdin-filename",
"%filepath"
],
"sourceName": "stylelint",
"parseJson": {
"errorsRoot": "[0].warnings",
"line": "line",
"column": "column",
"message": "${text}",
"security": "severity"
},
"securities": {
"error": "error",
"warning": "warning"
}
}
"standard": {
"command": "./node_modules/.bin/standard",
"isStderr": false,
"isStdout": true,
"args": ["--stdin", "--verbose"],
"rootPatterns": [".git"],
"debounce": 100,
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "standard",
"formatLines": 1,
"formatPattern": [
"^\\s*<\\w+>:(\\d+):(\\d+):\\s+(.*)(\\r|\\n)*$",
{
"line": 1,
"column": 2,
"message": 3
}
]
}
"hadolint": {
"command": "hadolint",
"sourceName": "hadolint",
"args": [
"-f",
"json",
"-"
],
"parseJson": {
"line": "line",
"column": "column",
"security": "level",
"message": "${message} [${code}]"
},
"securities": {
"error": "error",
"warning": "warning",
"info": "info",
"style": "hint"
}
}
"golangci-lint": {
"command": "golangci-lint",
"rootPatterns": [ ".git", "go.mod" ],
"debounce": 100,
"args": [ "run", "--out-format", "json" ],
"sourceName": "golangci-lint",
"parseJson": {
"sourceName": "Pos.Filename",
"sourceNameFilter": true,
"errorsRoot": "Issues",
"line": "Pos.Line",
"column": "Pos.Column",
"message": "${Text} [${FromLinter}]",
}
}
"textidote": {
"command": "textidote",
"debounce": 500,
"args": ["--check", "en_GB", "--output", "singleline"],
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "textidote",
"formatLines": 1,
"formatPattern": [
"^[^ ]+?\\(L(\\d+)C(\\d+)-L(\\d+)C(\\d+)\\)[^:]*?:(.*)\".*\"(\\r|\\n)*$",
{
"line": 1,
"column": 2,
"endLine": 3,
"endColumn": 4,
"message": 5
}
],
}
"tidy": {
"command": "tidy",
"args": ["-e", "-q"],
"rootPatterns": [".git/"],
"isStderr": true,
"debounce": 100,
"offsetLine": 0,
"offsetColumn": 0,
"sourceName": "tidy",
"formatLines": 1,
"formatPattern": [
"^.*?(\\d+).*?(\\d+)\\s+-\\s+([^:]+):\\s+(.*)(\\r|\\n)*$",
{
"line": 1,
"column": 2,
"endLine": 1,
"endColumn": 2,
"message": [4],
"security": 3
}
],
"securities": {
"Error": "error",
"Warning": "warning"
}
}
"hlint": {
"command": "hlint",
"debounce": 100,
"args": ["--json", "-"],
"sourceName": "hlint",
"parseJson": {
"line": "startLine",
"column": "startColumn",
"endLine": "endLine",
"endColumn": "endColumn",
"message": "${hint}",
"security": "severity"
},
"securities": {
"Error": "error",
"Warning": "warning",
"Suggestion": "info"
}
}
"pylint": {
"sourceName": "pylint",
"command": "pylint",
"args": [
"--output-format",
"text",
"--score",
"no",
"--msg-template",
"'{line}:{column}:{category}:{msg} ({msg_id}:{symbol})'",
"%file"
],
"formatPattern": [
"^(\\d+?):(\\d+?):([a-z]+?):(.*)$",
{
"line": 1,
"column": 2,
"security": 3,
"message": 4
}
],
"rootPatterns": [".git", "pyproject.toml", "setup.py"],
"securities": {
"informational": "hint",
"refactor": "info",
"convention": "info",
"warning": "warning",
"error": "error",
"fatal": "error"
},
"offsetColumn": 1,
"formatLines": 1
}
"revive": {
"command": "revive",
"rootPatterns": [ ".git", "go.mod" ],
"debounce": 100,
"args": [ "%file" ],
"sourceName": "revive",
"formatPattern": [
"^[^:]+:(\\d+):(\\d+):\\s+(.*)$",
{
"line": 1,
"column": 2,
"message": [3]
}
]
}
"mypy": {
"sourceName": "mypy",
"command": "mypy",
"args": [
"--no-color-output",
"--no-error-summary",
"--show-column-numbers",
"--follow-imports=silent",
"%file"
],
"formatPattern": [
"^.*:(\\d+?):(\\d+?): ([a-z]+?): (.*)$",
{
"line": 1,
"column": 2,
"security": 3,
"message": 4
}
],
"securities": {
"error": "error"
}
}
"cpplint": {
"command": "cpplint",
"args": ["%file"],
"debounce": 100,
"isStderr": true,
"isStdout": false,
"sourceName": "cpplint",
"offsetLine": 0,
"offsetColumn": 0,
"formatPattern": [
"^[^:]+:(\\d+):(\\d+)?\\s+([^:]+?)\\s\\[(\\d)\\]$",
{
"line": 1,
"column": 2,
"message": 3,
"security": 4
}
],
"securities": {
"1": "info",
"2": "warning",
"3": "warning",
"4": "error",
"5": "error"
}
}
"fish": {
"command": "fish",
"args": ["-n", "%file"],
"isStdout": false,
"isStderr": true,
"sourceName": "fish",
"formatLines": 1,
"formatPattern": [
"^.*\\(line (\\d+)\\): (.*)$",
{
"line": 1,
"message": 2
}
]
}