Skip to content

Commit

Permalink
Advance multiroot workcpaces support
Browse files Browse the repository at this point in the history
  • Loading branch information
tolezk committed Jul 26, 2022
1 parent fa14fb0 commit acc8f79
Show file tree
Hide file tree
Showing 3 changed files with 355 additions and 61 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ GNU 'diff' executable should also be available (can be done by installing [git-f
## Settings
* `checkpatch.checkpatchPath` Path to the checkpatch.pl script
* `checkpatch.checkpatchArgs` checkpatch arguments to use
* `checkpatch.useFolderAsCwd` Relative to multiroot workspace layout. Whether the linter should run in the workspace where the file is from or use the root workspace
* `checkpatch.run` Control whether the linting is automatic on save or manually triggered using the `checkpatch.checkFile` command.
* `checkpatch.exclude` Glob patterns for excluding files and folders from automatic checks.
* `checkpatch.diagnosticLevel` Diagnostic level of checkpatch errors.
35 changes: 28 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@
"checkpatch.checkpatchPath": {
"type": "string",
"default": "checkpatch.pl",
"description": "Path to the checkpatch.pl script"
"description": "Path to the checkpatch.pl script. Should be set at least for the root workspace",
"scope": "resource"
},
"checkpatch.checkpatchArgs": {
"type": "array",
"default": [
"--no-tree"
],
"description": "Arguments for the checkpatch script"
"description": "Arguments for the checkpatch script",
"scope": "resource"
},
"checkpatch.run": {
"type": "string",
Expand All @@ -51,12 +53,13 @@
"manual"
],
"default": "onSave",
"description": "Whether the linter is run automatically on save or manually."
"description": "Whether the linter is run automatically on save or manually"
},
"checkpatch.exclude": {
"type": "array",
"default": [],
"description": "Glob patterns for excluding files and folders from automatic checks."
"description": "Glob patterns for excluding files and folders from automatic checks",
"scope": "resource"
},
"checkpatch.diagnosticLevel": {
"type": "string",
Expand All @@ -68,21 +71,31 @@
],
"default": "Information",
"description": "Select the diagnostic level of checkpatch problems"
},
"checkpatch.useFolderAsCwd": {
"type": "boolean",
"default": false,
"description": "Whether the linter should use current folder as cwd or run from root folder instead. Only applies when there `#checkpatch.checkpatchPath#` is not set for current folder",
"scope": "resource"
}
}
},
"commands": [
{
"command": "checkpatch.checkFile",
"title": "Checkpatch Selected File"
"title": "Checkpatch: Check Selected File"
},
{
"command": "checkpatch.checkCommit",
"title": "Checkpatch Commit"
"title": "Checkpatch: Check Commit"
},
{
"command": "checkpatch.toggleAutoRun",
"title": "Toggle Checkpatch for the Current Workspace"
"title": "Checkpatch: Toggle Run Mode For The Current Workspace"
},
{
"command": "checkpatch.cleanDiagnostic",
"title": "Checkpatch: Clean Current Diagnostic"
}
],
"problemMatchers": [
Expand All @@ -103,6 +116,13 @@
"regexp": "#\\d+: FILE: (.*):(\\d+):",
"file": 1,
"line": 2
},
{
"regexp": "(.*):(\\d+): (WARNING|ERROR|CHECK): ?(.+):(.+)",
"file": 1,
"line": 2,
"severity": 3,
"message": 5
}
]
}
Expand Down Expand Up @@ -136,6 +156,7 @@
"@types/vscode": "^1.34.0",
"@typescript-eslint/eslint-plugin": "^3.0.2",
"@typescript-eslint/parser": "^3.0.2",
"esbuild": "^0.14.25",
"eslint": "^7.1.0",
"typescript": "^4.0.2"
},
Expand Down
Loading

0 comments on commit acc8f79

Please sign in to comment.