Skip to content

Commit

Permalink
Add VsCode support for pydoclint (#4241)
Browse files Browse the repository at this point in the history
Since flake8 has been removed, VsCode no longer provided feedback during
devleopment about new docstring errors.

This PR add a new task called `pydoclint` that runs pydoclint in the
background. Message from pydoclint are parsed with a regex and presented
in the problems tab of VsCode by the task.

VsCode does not have native support fdor running a task on save, so a
new extension is added to support that.

The flake8 extension is removed which was an oversight in #4235 

Related #4236
  • Loading branch information
cidrblock authored Jun 26, 2024
1 parent db97488 commit 4fe7993
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"recommendations": [
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"gruntfuggly.triggertaskonsave",
"markis.code-coverage",
"ms-python.black-formatter",
"ms-python.debugpy",
"ms-python.flake8",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.python",
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
"pylint.importStrategy": "fromEnvironment",
"python.testing.pytestArgs": ["tests"],
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false
"python.testing.unittestEnabled": false,
"triggerTaskOnSave.tasks": {
"pydoclint": ["*.py"]
}
}
31 changes: 31 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "pydoclint",
"type": "shell",
"command": "pydoclint",
"args": ["."],
"presentation": {
"reveal": "never"
},
"problemMatcher": {
"owner": "pydoclint",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": {
"regexp": "^(.*?):(\\d+):\\s(.*?):\\s(.*)$",
"file": 1,
"line": 2,
"code": 3,
"message": 4
}
},
"group": {
"kind": "none",
"isDefault": true
}
}
]
}

0 comments on commit 4fe7993

Please sign in to comment.