qurator-spk / dinglehopper

An OCR evaluation tool
Apache License 2.0
59 stars 13 forks source link

Use black code formatter #41

Closed b2m closed 5 months ago

b2m commented 3 years ago

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 https://github.com/qurator-spk/dinglehopper/pull/37#issuecomment-718830296

Note: black requires Python >= 3.6!

Todo:

mikegerber commented 3 years ago

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 3 years ago

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 =)

mikegerber commented 5 months ago

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.

mikegerber commented 5 months ago

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.