Skip to content

Commit acc8f79

Browse files
committed
Advance multiroot workcpaces support
1 parent fa14fb0 commit acc8f79

File tree

3 files changed

+355
-61
lines changed

3 files changed

+355
-61
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ GNU 'diff' executable should also be available (can be done by installing [git-f
3333
## Settings
3434
* `checkpatch.checkpatchPath` Path to the checkpatch.pl script
3535
* `checkpatch.checkpatchArgs` checkpatch arguments to use
36+
* `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
3637
* `checkpatch.run` Control whether the linting is automatic on save or manually triggered using the `checkpatch.checkFile` command.
3738
* `checkpatch.exclude` Glob patterns for excluding files and folders from automatic checks.
3839
* `checkpatch.diagnosticLevel` Diagnostic level of checkpatch errors.

package.json

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@
3535
"checkpatch.checkpatchPath": {
3636
"type": "string",
3737
"default": "checkpatch.pl",
38-
"description": "Path to the checkpatch.pl script"
38+
"description": "Path to the checkpatch.pl script. Should be set at least for the root workspace",
39+
"scope": "resource"
3940
},
4041
"checkpatch.checkpatchArgs": {
4142
"type": "array",
4243
"default": [
4344
"--no-tree"
4445
],
45-
"description": "Arguments for the checkpatch script"
46+
"description": "Arguments for the checkpatch script",
47+
"scope": "resource"
4648
},
4749
"checkpatch.run": {
4850
"type": "string",
@@ -51,12 +53,13 @@
5153
"manual"
5254
],
5355
"default": "onSave",
54-
"description": "Whether the linter is run automatically on save or manually."
56+
"description": "Whether the linter is run automatically on save or manually"
5557
},
5658
"checkpatch.exclude": {
5759
"type": "array",
5860
"default": [],
59-
"description": "Glob patterns for excluding files and folders from automatic checks."
61+
"description": "Glob patterns for excluding files and folders from automatic checks",
62+
"scope": "resource"
6063
},
6164
"checkpatch.diagnosticLevel": {
6265
"type": "string",
@@ -68,21 +71,31 @@
6871
],
6972
"default": "Information",
7073
"description": "Select the diagnostic level of checkpatch problems"
74+
},
75+
"checkpatch.useFolderAsCwd": {
76+
"type": "boolean",
77+
"default": false,
78+
"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",
79+
"scope": "resource"
7180
}
7281
}
7382
},
7483
"commands": [
7584
{
7685
"command": "checkpatch.checkFile",
77-
"title": "Checkpatch Selected File"
86+
"title": "Checkpatch: Check Selected File"
7887
},
7988
{
8089
"command": "checkpatch.checkCommit",
81-
"title": "Checkpatch Commit"
90+
"title": "Checkpatch: Check Commit"
8291
},
8392
{
8493
"command": "checkpatch.toggleAutoRun",
85-
"title": "Toggle Checkpatch for the Current Workspace"
94+
"title": "Checkpatch: Toggle Run Mode For The Current Workspace"
95+
},
96+
{
97+
"command": "checkpatch.cleanDiagnostic",
98+
"title": "Checkpatch: Clean Current Diagnostic"
8699
}
87100
],
88101
"problemMatchers": [
@@ -103,6 +116,13 @@
103116
"regexp": "#\\d+: FILE: (.*):(\\d+):",
104117
"file": 1,
105118
"line": 2
119+
},
120+
{
121+
"regexp": "(.*):(\\d+): (WARNING|ERROR|CHECK): ?(.+):(.+)",
122+
"file": 1,
123+
"line": 2,
124+
"severity": 3,
125+
"message": 5
106126
}
107127
]
108128
}
@@ -136,6 +156,7 @@
136156
"@types/vscode": "^1.34.0",
137157
"@typescript-eslint/eslint-plugin": "^3.0.2",
138158
"@typescript-eslint/parser": "^3.0.2",
159+
"esbuild": "^0.14.25",
139160
"eslint": "^7.1.0",
140161
"typescript": "^4.0.2"
141162
},

0 commit comments

Comments
 (0)