haikuporter
haikuporter copied to clipboard
[DRAFT] Formatted files with yapf
Formatted python files with yapf. Commands used:
$ yapf -r --style='{based_on_style:pep8,use_tabs:True,column_limit=88}' --in-place haikuporter.py
$ yapf -r --style='{based_on_style:pep8,use_tabs:True,column_limit=88}' --in-place HaikuPorter/
Base on PEP8. Key differences from PEP8:
- Line length set to 88 characters instead of 79
- Used tabs instead of 4 spaces
I've noticed the same issues - changing title to draft as this is under development to address and fix all issues.
But what changes does this actually produce, then? Most of the differences are due to those 3 problems I noted. Once they are corrected, what "differences" will remain?
I think the code is formatted mostly fine as-is, and we don't need to reformat it "just because".
Main goal was to prepare codebase for linters and implementing CI for checking imports order, basic styling/formatting of the code for each new PR. I'm also trying to figure out which tool and how can be used by other users to quickly format the code before committing any changes.
I don't know if we can use machine-formatted code, due to the second item listed above at least (comments on next lines should be indented.) There's probably others (e.g. I see various multiline object initializers were condensed to one line.)
I'll try to create a draft document with coding guidelines and tools possible to use for formatting :) I'll take Haiku Coding Guidelines as a base.
Do we really need a separate document, though?
An "addendum" or "supplement" document describing only the differences would likely make much more sense.
@waddlesplash I had exactly that on my mind - some kind of appendix to existing documentation. "Documentation" sounds pretty serious but all in all every comment is in some way a kind of documentation ;)
This PR is almost year old. I'm closing it since another approach was proposed in the comments.