Enable problem matcher for `black`
See original GitHub issueTask
Enable a problem matcher for black to mark unformatted python scripts:
Instructions
- Create
.github/workflows/matchers/black.json
that looks like this:
{
"problemMatcher": [
{
"owner": "black",
"severity": "error",
"pattern": [
{
"regexp": "^(would reformat) (.+)$",
"file": 2,
"message": 1
}
]
}
]
}
- Make the following changes to enable the problem matcher for black:
diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
index 19ec5c411..9f1c710d3 100644
--- a/.github/workflows/master.yml
+++ b/.github/workflows/master.yml
@@ -53,6 +53,7 @@ jobs:
- name: Add problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
+ echo "::add-matcher::.github/workflows/matchers/black.json"
- name: Install dependencies
env:
INSTALL_LARGE_PYTHON_DEPS: true
diff --git a/dev/lint.sh b/dev/lint.sh
index 972bffe32..bdbd239a7 100755
--- a/dev/lint.sh
+++ b/dev/lint.sh
@@ -7,7 +7,7 @@ trap 'err=1' ERR
echo -e "\n========== black ==========\n"
# Exclude proto files because they are auto-generated
-black --check .
+black --check --verbose .
if [ $? -ne 0 ]; then
echo '
Related PR
Issue Analytics
- State:
- Created a year ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Makefile Tools December 2021 Update: Problem Matchers ...
The December 2021 update of the Makefile Tools extension for Visual Studio Code is here, bringing you support for problem matchers (to ...
Read more >Tasks in Visual Studio Code
VS Code can process the output from a task with a problem matcher. Problem matchers scan the task output text for known warning...
Read more >Where are the in-the-box problem matchers defined?
As mentioned in the comments, the source for the problem matchers are found in the package.json of the built-in extensions.
Read more >Troubleshoot when your thermostat won't turn on
Follow the troubleshooting steps below that match the issue you're seeing. Before you begin. Your thermostat should automatically turn on once it's connected...
Read more >Documentation | SpaceVim
Custom tasks; Task Problems Matcher; Task auto-detection; Task provider ... Neovim on iTerm2 using the SpaceVim color scheme base16-solarized-dark.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Sumanth077 You’re welcome 😃 Thanks for working on this issue!
@harupy working on it.