Black: Black is making my python code look like Java

Created on 7 Jun 2019  路  1Comment  路  Source: psf/black

Howdy! Sorry you're having trouble. To expedite your experience,
provide some basics for me:
the crux of the issue is that all my python code i've written is starting to resemble java. instead of looking for indentation to determine what's going on in the code, i'm starting to have to look for colons. is breaking out a conditional statement into ten lines intended behavior?

please do the needful

Operating system: Mac OS X
Python version: 2.7.10
Black version: 19.3
Does also happen on master: yes

To answer the last question, you have two options:

  1. Use the online formatter at https://black.now.sh/?version=master, which will use the latest master branch.
  2. Or run black on your machine:

    • create a new virtualenv (make sure it's the same Python version);

    • clone this repository;

    • run pip install -e .;

    • make sure it's sane by running python setup.py test; and

    • run black like you did last time.

Most helpful comment

If you write long conditionals, they'll end up being split into many lines. If you have a concrete example of code formats poorly and suggestions on how to format it better, we're happy to listen.

>All comments

If you write long conditionals, they'll end up being split into many lines. If you have a concrete example of code formats poorly and suggestions on how to format it better, we're happy to listen.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brettcannon picture brettcannon  路  3Comments

J0 picture J0  路  3Comments

madig picture madig  路  3Comments

JelleZijlstra picture JelleZijlstra  路  3Comments

uranusjr picture uranusjr  路  3Comments