in-toto / apt-transport-in-toto

in-toto transport for apt
Other
8 stars 6 forks source link

Reformat python: make PEP8 happier #36

Open fepitre opened 3 years ago

fepitre commented 3 years ago

This is only code polishing to make PEP8 happier.

fepitre commented 3 years ago

@lukpueh Travis seems to not want to build something...

lukpueh commented 3 years ago

Thanks for the patch, @fepitre!

I must say that I am a bit reluctant to have a flag day like this, without providing an automated linting (and ideally formatting) config that aligns to our python style guide, which we btw. just updated to make it more PEP 8 compliant (e.g. 4 instead of 2 spaces, etc.).

Do you have a linter or auto-formatter config you'd like to share? FWIW, I plan to work on such a config in the near future. Would you mind if we defered this change until then?

Also, if we do re-format all the code, it would be nice to apply individual rules commit by commit, e.g. one for indentation, one for line continuation, etc. This will make it a lot easier to trace and review the changes.

lukpueh commented 3 years ago

Travis seems to not want to build something...

Yes, it seems like we have consumed our build minutes for this GitHub org. Travis says:

"Builds have been temporarily disabled for public repositories due to a negative credit balance."

I hope our credit replenishes soon. Also, in the future we are unlikely to use it up so easily, because we stopped using Travis for in-toto/in-toto, which probably ate most of the free build minutes.

fepitre commented 3 years ago

@lukpueh no problem. It's currently built-in reformat with PEP8 from pycharm community. I can help you into having linter checks into CI. I know that there is a radical one for PEP8: https://github.com/psf/black. Maybe we can check this one.

lukpueh commented 3 years ago

Yes! black is on my list. I haven't worked with it yet, but I guess it's doable. :)

FYI, I'm doing this for https://github.com/theupdateframework/tuf/issues/1178 (TUF is in-toto's sister project). But whatever setup we end up with should be good for in-toto projects as well.