python-black Questions

1

Solved

Anytime there is an inline assertion rule to be verified against a bool statement, using the python black formatter in VSCode will break the line causing flake8 to warn about rule W503 line break b...
Alveolus asked 28/6, 2021 at 10:26

4

Solved

Does the Python formatting tool Black have an option for undoing the formatting changes it made after it's been run? Or does it assume I'm using source control and making my own backups? This is as...
Arteaga asked 10/12, 2019 at 0:57

1

Solved

I am switching over to using Black for all my Python projects from now on. Till now I had been using autopep8 as my auto-formatter and isort to sort my imports. But while using Black I found out th...
Sensitivity asked 21/5, 2021 at 13:30

2

Solved

We are not ready to automatically format the whole source code with black. But from time to time I would like to execute black -S on a region via PyCharm. There is a hint in the docs how to run bla...
Bowshot asked 29/1, 2021 at 8:39

2

Solved

Let's say I have the following python file exclude_from_black.py in the root of my project: print('I want single quotes') I'm trying to exclude this file from black reformatting but none of the ...
Nyx asked 15/11, 2019 at 17:50

1

Solved

This code was created by black: def test_schema_org_script_from_list(): assert ( schema_org_script_from_list([1, 2]) == '<script type="application/ld+json">1</script>\n<...
Pudendum asked 20/1, 2021 at 11:59

2

Solved

We're applying Black code style to a django project. In all the tutorials / examples I find (such as in django cookiecutter and this blog), I keep seeing django's migrations files excluded from th...
Polyp asked 31/5, 2020 at 16:16

0

I am using pre-commit with black and flake8 hooks. I got this error: cannot format when trying to black-format the following code from {{cookiecutter.project_name}} import my_module Is there anywa...
Palikar asked 29/6, 2020 at 23:49

1

Solved

I'm running git pre-commit and running black as one of the hooks. Now when I run commit, black fails and says: All done! ✨ 🍰 ✨ 15 files reformatted, 1 file left unchanged. I reviewed the refor...
Unhallowed asked 8/5, 2020 at 0:21

3

I would like to apply black whenever I save a Python file in Sublime Text 3. How can I do that? (Bonus points if there is a quick way to disable it)
Micmac asked 31/7, 2019 at 10:51

0

I'm currently experimenting with the Black code formatter for Python. In >90% of the cases I am happy with the output (with default configs), but it regularly happens, that it formats some li...
Grasshopper asked 27/12, 2018 at 20:22

© 2022 - 2024 — McMap. All rights reserved.