Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim: prefix messages with "Black:" #3194

Merged
merged 2 commits into from Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Expand Up @@ -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 -->
Expand Down
6 changes: 3 additions & 3 deletions autoload/black.vim
Expand Up @@ -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 = []
Expand All @@ -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("@%")
Expand Down