Skip to content

Proposal: Enforce consistent code style with black, isort, and pre-commit #699

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

Conversation

ericrallen
Copy link
Collaborator

Describe the changes you have made:

This adds black, isort, and pre-commit to the repository and runs black and isort on a pre-commit hook to help ensure that we have consistent code style across the codebase in order to eliminate a lot of the noise in Pull Requests where someone has accidentally formatted something differently due to their editor's settings.

Reference any relevant issue (Fixes #000)

  • I have performed a self-review of my code:

I have tested the code on the following OS:

  • Windows
  • MacOS
  • Linux

AI Language Model (if applicable)

  • GPT4
  • GPT3
  • Llama 7B
  • Llama 13B
  • Llama 34B
  • Huggingface model (Please specify which one)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should preserve the regular git blame history for commits prior to the automated formatting commit and only show that commit as the git blame for newly added whitespace or removed whitespace changes.

@ericrallen ericrallen force-pushed the feature/automated-formatting branch from e34be0f to 4a9d472 Compare October 30, 2023 16:49
@ericrallen
Copy link
Collaborator Author

@KillianLucas the one thing I'm not sure about is if each developer needs to run pre-commit install locally, so it might be good to checkout this branch and see if the hooks run when you try to commit to it.

We can add a note to the Contributing Guide if necessary.

@KillianLucas KillianLucas merged commit ac71e20 into openinterpreter:main Nov 1, 2023
joshuavial pushed a commit to joshuavial/open-interpreter that referenced this pull request Nov 16, 2023
…utomated-formatting

Proposal: Enforce consistent code style with black, isort, and pre-commit
Former-commit-id: ac71e20
Former-commit-id: 5018ae27f9892012af39e6d8c600142e62a2310f
Former-commit-id: 02a4b67ef2eb7b0011863dae01bd2715c7f2c1e5 [formerly b1d3da6823de1c456064bb0686ce117c7c5c39cf]
Former-commit-id: 6a270bb8b6bc2bde12a46644f836fb69340614e7
joshuavial pushed a commit to joshuavial/open-interpreter that referenced this pull request Nov 16, 2023
…utomated-formatting

Proposal: Enforce consistent code style with black, isort, and pre-commit
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.

2 participants