Skip to content

Format Python scripts with black

Pino Toscano requested to merge pinotree/osinfo-db:python-black into main

Use 'black'[1][2] to format the Python scripts, so there is an uniform code style automatically applied to all the files. The normalization of strings is applied in a second commit, to ease the review and the general browsing of history. After this MR is merged, it will be possible to simply run black to reformat and keep the code style up-to-date.

Also, apply few manually touches to few scripts to shorten the length of lines with comments to fit within the 88 characters (i.e. the default line length of 'black').

Adapt the flake8 configuration to the changes in the Python sources.

Once merged, I will do a followup MR to add a .git-blame-ignore-revs file with the revisions of the 4 commits that format code/comments, so it will be possible to ignore them from the git blame output.

[1] https://github.com/psf/black
[2] https://black.readthedocs.io/en/stable/

Edited by Pino Toscano

Merge request reports