qurator-spk/dinglehopper

Use black code formatter

b2m opened this issue · 4 comments

b2m commented

Joking aside, I think I'll just use the black code formatter in the future, reasonable results and no more arguing about bike sheds... eh code formatting.

Originally posted by @mikegerber in #37 (comment)

Note: black requires Python >= 3.6!

Todo:

I'm contemplating to not reformat the code base but just require it for new changes. Mainly because GitHub does not allow to ignore a pure reformat commit.

b2m commented

I'm contemplating to not reformat the code base but just require it for new changes. Mainly because GitHub does not allow to ignore a pure reformat commit.

As the most code is written by you this should be a non issue and I would guess the other contributors will aggree =)

Reviewng this to close the issue. Only small inconsistency now that I use pre-commit:

        sys.argv[1:] = (
            args  # XXX Hack to satisfy ocrd_cli_wrap_processor() check for arguments                        
        )   

This gets formatted differently by pre-commit's black vs. black. Didn't bother to check the configuration and just moved the comment outside the parens - it was bad style anyway.

README-DEV.md has info about pre-commit, and .editorconfig is in place. That should do it IMO, as I don't want to make it mandatory.