Skip to content
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

[Build] Start enforcing code format #809

Closed

Conversation

riedgar-ms
Copy link
Collaborator

Although a previous change ran black on the entire codebase, this wasn't being enforced. Such leniency ends now.

@codecov-commenter
Copy link

codecov-commenter commented May 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.10%. Comparing base (b2522fd) to head (2ec70c3).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #809      +/-   ##
==========================================
+ Coverage   56.72%   62.10%   +5.38%     
==========================================
  Files          56       56              
  Lines        4159     4159              
==========================================
+ Hits         2359     2583     +224     
+ Misses       1800     1576     -224     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@riedgar-ms
Copy link
Collaborator Author

Please note that this PR is running on the "silence is assent" principle.

@Harsha-Nori
Copy link
Collaborator

Upon discussion with @slundberg, I think we'll want to experiment with the changing black settings before auto-enforcing it through the whole codebase. It was good to kick the tires on how we feel developing in a black formatted environment, but there's some annoyances that I think setting changes could iron out.

For example, we should see if we can disable the excessive multi-lining that happens on lines like this:

image

or

image

I also think black behaves a bit oddly when we have trailing comments on a line explaining what that line does. For example, the change to this else clause in the Engine.next() method is particularly gratuitous, and I think it's just because we have a comment explaining the line.

image

I suspect many of these will be solved/mitigated by just extending the default line length to e.g. 120. Some investigation into if there's a config change we can make to better handle the "short code, long comment" on a line too would be good.

@riedgar-ms
Copy link
Collaborator Author

Closing for now.

@riedgar-ms riedgar-ms closed this May 14, 2024
@riedgar-ms riedgar-ms deleted the riedgar-ms/black-enforcement-01 branch August 26, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants