Howdy! Sorry you're having trouble. To expedite your experience,
provide some basics for me:
Operating system:
Python version: Python 3.7.3
Black version: black, version 19.3b0
Does also happen on master: Yes
When I run $ black *
requirements.txt which contains opencv-python this is getting updated to opencv - python.config.settings["foo"]["bar"]["baz"] = 1 is getting converted to:config.settings["foo"]["bar"][
"baz"
] = 1
even within the max line.
For your first problem, you should probably run black . instead, so Black runs only on Python files, not files that aren't Python but happen to be parseable as such.
For your second problem, I cannot reproduce it locally with the same Python and Black 19.3b0 or with black.now.sh (also 19.3b0).
What config settings do you have?
I can reproduce "Mishap 2" using line length 30:
black.now.sh
But this is probably not a very typical setting.
@robin-bloehm-mck what do you prefer Black to do in that case?
Most helpful comment
For your first problem, you should probably run
black .instead, so Black runs only on Python files, not files that aren't Python but happen to be parseable as such.