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

Format Python code with black #2778

Merged
merged 10 commits into from
Oct 12, 2022
Merged

Format Python code with black #2778

merged 10 commits into from
Oct 12, 2022

Conversation

eriknw
Copy link
Contributor

@eriknw eriknw commented Oct 5, 2022

closes #2527

I also added .pre-commit-config.yaml to make this easier to use and match versions (for example, I kept using a newer flake8 locally). This uses the versions of black and flake8 that are in the rapids environment in the docker container. There's a lot more we can do with pre-commit, but I didn't want to be overzealous in this PR.

After this PR is merged, we should add a .git-blame-ignore-revs file so that I won't get blamed for everything :) . See:

Once this is merged, existing PRs should probably run black (version 22.3.0) on their branch before merging 22.12 branch into their branch.

This changes the maximum line length to 88, which is the default for black

@eriknw eriknw requested review from a team as code owners October 5, 2022 23:52
@rlratzel rlratzel added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Oct 6, 2022
@rlratzel rlratzel added this to the 22.12 milestone Oct 6, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.12@9ee03f2). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@               Coverage Diff               @@
##             branch-22.12    #2778   +/-   ##
===============================================
  Coverage                ?   60.44%           
===============================================
  Files                   ?      111           
  Lines                   ?     6515           
  Branches                ?        0           
===============================================
  Hits                    ?     3938           
  Misses                  ?     2577           
  Partials                ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@eriknw
Copy link
Contributor Author

eriknw commented Oct 6, 2022

For sanity and convenience, this PR has a companion branch and PR #2780 that has the necessary changes before running black.

#2780 will be useful for keeping this branch up to date as PRs get merged, and for updating other PRs once this PR gets merge.

To verify the correctness of this PR, check out #2780 and run pre-commit run --all-files. The result should match this PR exactly.

@rlratzel rlratzel linked an issue Oct 6, 2022 that may be closed by this pull request
@wence-
Copy link
Contributor

wence- commented Oct 10, 2022

FWIW, when this comes to merge, recommend squashing all the formatting commits and adding the final "change everything" commit hash to a top-level .git-blame-ignore-revs file. Then one can do git config blame.ignoreRevsFile .git-blame-ignore-revs and git blame will skip over this commit when assigning attribution to changed lines.

Copy link
Contributor

@rlratzel rlratzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this contains the same changes as #2780 + changes as the result of running black

@eriknw
Copy link
Contributor Author

eriknw commented Oct 12, 2022

Test failure is from a timeout in a test.

@rlratzel
Copy link
Contributor

rerun tests

reason: timeout failure while running a test that doesn't appear related to the PR changes, assuming it's a transient CI problem.

@rlratzel
Copy link
Contributor

@gpucibot merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add black formatting
5 participants