Need a switch army knife for formating source code files? Here comes vim-autoformat.
Many languages are configured by default. Most languages come with an autoformat capability.
So vim-autoformat can work probably, python support is needed. You can install the python support for vim with
python3 -m pip install pynvim
Additionally the python host should be set
let g:python3_host_prog='/usr/bin/python3'
nmap <Leader>a :Autoformat<CR>
<Leader>a
gives you a quick access to autoformat.
The current buffer will be replaced with the formated content.
Plug 'chiel92/vim-autoformat'