-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run black on codebase #765
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #765 +/- ##
==========================================
- Coverage 65.68% 65.68% -0.01%
==========================================
Files 55 55
Lines 4060 4059 -1
==========================================
- Hits 2667 2666 -1
Misses 1393 1393 ☔ View full report in Codecov by Sentry. |
@@ -11,6 +11,7 @@ node_modules | |||
/client | |||
.eggs/ | |||
.env | |||
.DS_Store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Someone has a Mac....
blanks = ( | ||
"\n" * f.__code__.co_firstlineno | ||
) # padd the source so the lines in the file line up for the debugger | ||
source = blanks + "\n".join( | ||
source.splitlines()[1:] | ||
) # remove the decorator first line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in general, I'm not a fan of how black
handles long-ish lines with trailing comments. I suppose I'd prefer that it moves trailing comment lines to the preceding line, and then keep the source as a single compact line. But a standard is a standard 🤷♂️ . Would be nice for the future if there's a way to configure this better though, as I think:
# padd the source so the lines in the file line up for the debugger
blanks = "\n" * f.__code__.co_firstlineno
looks much nicer than
blanks = (
"\n" * f.__code__.co_firstlineno
) # padd the source so the lines in the file line up for the debugger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@riedgar-ms @ryanpeach curious about your thoughts here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree with your preference, although it's more something that could be fixed up as people review the code afterwards rather than needing to go through all the files now.
Much appreciated! |
Running
black
on the codebase to standardize things and set us up for auto formatting as our contributor base grows.Following git/github's conventions with a
.git-blame-ignore-revs
file to not affect git blame: https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-viewAlso fixes a small merge issue in #759 by deprecating
guidance.newline
, which is causing a notebook test failure.I believe
isort
is still causing some issues with circular imports, so not enforcing that entirely for now.