lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Run formatting tools


From: Jean Abou Samra
Subject: Re: Run formatting tools
Date: Fri, 25 Sep 2020 16:01:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0


Le 25/09/2020 à 15:48, Jonas Hahnfeld a écrit :
You could put this in a pyproject.toml file:

[tool.black]
line-length=78

Then the command would be just ``black .``
Not sure why 78 characters? PEP 8 says 79 characters for code or at
most 72 for doc-strings.

I don't know, just took this figure from Werner.

Anyway, running black on all Python files gives the following error:

     error: cannot format 
/code/LilyPond/src/scripts/auxiliar/translations-status.py: INTERNAL ERROR: 
Black produced different code on the second pass of the formatter.
I can't reproduce this. What is your version of Black? (Mine is 19.3b0.) What line length did you use?
Also, it seems to change every occurrence of single quotes to double
quotes unless there are already double quotes. My impression is that
single quotes are used more widespread, and the diff is massive at
56 files changed, 10819 insertions(+), 7704 deletions(-)
https://github.com/psf/black#testimonials

Dusty Phillips, writer <https://smile.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=dusty+phillips>:

   /Black/is opinionated so you don't have to be.

That's both the advantage and the drawback.

Personally I don't find the diff to be a huge problem
since the autopep8 reformatting already modified the blame.

I don't care enough of the Python formatting for now so I've removed
that commit from the mentioned MR. The obvious caveat is that we must
not run such large-scale formatting if we finally create a stable
branch (not discussed here), or apply the same run for the branch as
well.
Yeah, Python should be tackled in another MR if at all. Thanks
for raising this.

Best,
Jean



reply via email to

[Prev in Thread] Current Thread [Next in Thread]