Python’s Black formatter: how to disable formatting of import statements? [closed]

I'm using the black python code formatter. But many times it automatically rearranges the files' import statements causing circular dependencies. Is there a way to prevent it from formatting import statements? I'm currently running it using vim's ale plugin, but I'm open to just run it from the terminal.

Edit: turns out it's not Black, but the other fixer I'm using, autopep8.

Read more here:

Content Attribution

This content was originally published by Zaid Gharaybeh at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: