question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable problem matcher for `black`

See original GitHub issue

Task

Enable a problem matcher for black to mark unformatted python scripts:

Instructions

  1. Create .github/workflows/matchers/black.json that looks like this:
{
  "problemMatcher": [
    {
      "owner": "black",
      "severity": "error",
      "pattern": [
        {
          "regexp": "^(would reformat) (.+)$",
          "file": 2,
          "message": 1
        }
      ]
    }
  ]
}
  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

https://github.com/mlflow/mlflow/pull/5639

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
harupycommented, May 30, 2022

@Sumanth077 You’re welcome 😃 Thanks for working on this issue!

1reaction
Sumanth077commented, May 26, 2022

@harupy working on it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found