Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a862795

Browse files
bryanforbesJelleZijlstra
authored andcommitted
Format pyi files correctly (psf#599)
1 parent 66aa676 commit a862795

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

plugin/black.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ def Black():
102102
mode = black.FileMode.AUTO_DETECT
103103
if bool(int(vim.eval("g:black_skip_string_normalization"))):
104104
mode |= black.FileMode.NO_STRING_NORMALIZATION
105+
if vim.current.buffer.name.endswith('.pyi'):
106+
mode |= black.FileMode.PYI
105107
buffer_str = '\n'.join(vim.current.buffer) + '\n'
106108
try:
107109
new_buffer_str = black.format_file_contents(buffer_str, line_length=line_length, fast=fast, mode=mode)

0 commit comments

Comments
 (0)