[jira] [Commented] (AVRO-3148) Use black for Python style/formatting

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (AVRO-3148) Use black for Python style/formatting

Dave Cole (Jira)

    [ https://issues.apache.org/jira/browse/AVRO-3148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17353554#comment-17353554 ]

ASF subversion and git services commented on AVRO-3148:
-------------------------------------------------------

Commit 8c156bd10af22f5bda22a926f86c21e93b12ab4e in avro's branch refs/heads/master from Michael A. Smith
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=8c156bd ]

AVRO-3148: Format Python with Black (#1233)

* AVRO-3148: Format Python with Black

Updating tox.ini to use black for lint checks going forward.

Also Ran:

```
pyupgrade --py36-plus $(git ls-files '*.py')
isort --line-length 150 --profile black $(git ls-files '*.py')
black --line-length 150 $(git ls-files '*.py')
```

* AVRO-3148: Only Typecheck/Lint on One Python

The default GitHub Actions image has trouble installing black and mypy.
Besides, lint checks only need to pass in one version of python.
So, to save time and energy, we explicitly run these in the latest
Python only.

> Use black for Python style/formatting
> -------------------------------------
>
>                 Key: AVRO-3148
>                 URL: https://issues.apache.org/jira/browse/AVRO-3148
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: build, python
>    Affects Versions: 1.10.2
>            Reporter: Michael A. Smith
>            Priority: Major
>
> Avro uses spotless for java, but its implementation hasn't been rolled out to other languages yet. Spotless has support for black, the python formatter, but the lang/py implementation doesn't use black yet.
> I propose to do a conversion of the python implementation to black, including
> 1. Reformatting everything.
> 2. Replacing pycodestyle with black in as the basic linter.
> 3. Maybe enabling spotless to run the black check on Python, if it makes sense.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)