We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
In the following code:
import math # a most excellent class class MyClass: PI = math.pi
Black fails to add an extra newline before the comment. This causes flake8 to give an E302 error.
Black does add a newline if you delete the comment, so I think this is an issue with Black.
To Reproduce Run this in Bash on a Linux/Unix system:
cat > foo.py <<EOF import math # a most excellent class class MyClass: PI = math.pi EOF python3 -m black foo.py python3 -m flake8 foo.py
black will output
All done! ✨ 🍰 ✨ 1 file left unchanged.
and flake8 will output
foo.py:4:1: E302 expected 2 blank lines, found 1
Expected behavior
Black adds a newline, and flake8 does not produce an error.
Environment
$ python3 -m black --version python -m black, 22.10.0 (compiled: yes) Python (CPython) 3.10.8 $ python3 -m flake8 --version 5.0.4 (mccabe: 0.7.0, pycodestyle: 2.9.1, pyflakes: 2.5.0) CPython 3.10.8 on Darwin $ python3 --version Python 3.10.8 $ sw_vers ProductName: macOS ProductVersion: 12.5 BuildVersion: 21G72
The text was updated successfully, but these errors were encountered:
Hi, this has been just fixed in --preview (playground example, #3302) coming your way in the next release. I'll close this issue as a duplicate!
--preview
Sorry, something went wrong.
No branches or pull requests
Describe the bug
In the following code:
Black fails to add an extra newline before the comment. This causes flake8 to give an E302 error.
Black does add a newline if you delete the comment, so I think this is an issue with Black.
To Reproduce
Run this in Bash on a Linux/Unix system:
black will output
and flake8 will output
Expected behavior
Black adds a newline, and flake8 does not produce an error.
Environment
The text was updated successfully, but these errors were encountered: