]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Vim plugin: prefix messages with "Black: " (#3194)
authorThéophile Bastian <contact@tobast.fr>
Thu, 28 Jul 2022 23:49:00 +0000 (01:49 +0200)
committerGitHub <noreply@github.com>
Thu, 28 Jul 2022 23:49:00 +0000 (19:49 -0400)
As mentioned in GH-3185, when using Black as a Vim plugin, especially
automatically on save, the plugin's messages can be confusing, as
nothing indicates that they come from Black.

CHANGES.md
autoload/black.vim

index 94c3bdda68e847d44bc6681e9f6562c1fb904a25..e027b2cae714deb9c04c8903fc309711dc888e55 100644 (file)
@@ -46,6 +46,8 @@
 
 <!-- For example, Docker, GitHub Actions, pre-commit, editors -->
 
+- Vim plugin: prefix messages with `Black: ` so it's clear they come from Black (#3194)
+
 ### Output
 
 <!-- Changes to Black's terminal output and error messages -->
index 6c381b431a36ebb0d03f6d7792b1efe4937652dd..ed657be7bd3aba5b311a798956d9c4a86db26daf 100644 (file)
@@ -158,9 +158,9 @@ def Black(**kwargs):
     )
   except black.NothingChanged:
     if not quiet:
-      print(f'Already well formatted, good job. (took {time.time() - start:.4f}s)')
+      print(f'Black: already well formatted, good job. (took {time.time() - start:.4f}s)')
   except Exception as exc:
-    print(exc)
+    print(f'Black: {exc}')
   else:
     current_buffer = vim.current.window.buffer
     cursors = []
@@ -177,7 +177,7 @@ def Black(**kwargs):
       except vim.error:
         window.cursor = (len(window.buffer), 0)
     if not quiet:
-      print(f'Reformatted in {time.time() - start:.4f}s.')
+      print(f'Black: reformatted in {time.time() - start:.4f}s.')
 
 def get_configs():
   filename = vim.eval("@%")