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

Black Format Codebase #251

Closed

Conversation

hminsky2002
Copy link

Reference Issues/PRs

Fixes #195

What does this implement/fix? Explain your changes.

This large commit introduces black formatting to the codebase, as well as adding black formatting as a pre-commit hook. Furthermore, it introduces an ignoreRev file that can be used to locally configure your git to ignore the revisions made in the extremely large reformatting commit when looking at blame logs.

Files Formatted:
All .py files
Files added:
.git-blame-ignore-revs
Files Modified:
.pre-commit-config.yaml

Any other comments?

This is understandably a huge PR, more just implemented as a jumping off point, there may be specific black configurations that would be more desirable. Happy to refactor/reedit, or just leave as an example!
🧡 Thanks for contributing!

This commit formats all .py files in the codebase
with the black formatter python package, as well as
adds the black package to the environment.yml file.

Issue princeton-nlp#195 Black Format Codebase
This commit adds a file to ignore the initial black
formatting of the entire codebase via gitblame. Since it
was an extremely large commit, it could clutter the working
tree/blamelog, so this supplies the option and instructions
to ignore the specific commit when developing

Issue princeton-nlp#195 Black Format Codebase
@hminsky2002
Copy link
Author

@klieret Here's another one, an attempt at sensibly introducing black formatting to the repository both retroactively and forwardly as a pre-commit hook. Let me know what you think!

This commit adds the black formatter as a pre-commit hook to the
repository

Issue princeton-nlp#195 Black Format Codebase
Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 62.43655% with 74 lines in your changes are missing coverage. Please review.

Project coverage is 72.86%. Comparing base (799f07e) to head (eff7694).

❗ Current head eff7694 differs from pull request most recent head bc53810. Consider uploading reports for the commit bc53810 to get more accurate results

Files Patch % Lines
sweagent/agent/commands.py 26.08% 17 Missing ⚠️
sweagent/agent/models.py 11.76% 15 Missing ⚠️
sweagent/agent/history_processors.py 15.38% 11 Missing ⚠️
sweagent/environment/utils.py 73.80% 11 Missing ⚠️
sweagent/environment/swe_env.py 73.33% 8 Missing ⚠️
run.py 61.53% 5 Missing ⚠️
run_replay.py 70.00% 3 Missing ⚠️
sweagent/agent/parsing.py 75.00% 3 Missing ⚠️
sweagent/agent/agents.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #251      +/-   ##
==========================================
- Coverage   72.88%   72.86%   -0.03%     
==========================================
  Files          17       17              
  Lines        2545     2543       -2     
==========================================
- Hits         1855     1853       -2     
  Misses        690      690              

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

@klieret
Copy link
Member

klieret commented Apr 17, 2024

Hi sorry @hminsky2002 , but I had assigned this issue to myself because I need to talk with the team again about this first. Also, such a PR will almost certainly merge conflict if not directly merged, so I'll have to close it (as it is more time to keep this updated).

Again sorry for the work you already put in this!

@klieret klieret closed this Apr 17, 2024
@klieret
Copy link
Member

klieret commented Apr 17, 2024

image
you can see if someone was already assigned to an issue on the right side ;)

@hminsky2002
Copy link
Author

@klieret No sweat! Was a neat experience working with pre-commit hooks, and I should've checked to see if there were any current assignees(duh).

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.

Black format codebase
2 participants