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

Pre-commit hook with black #5

Merged
merged 7 commits into from
Apr 18, 2024
Merged

Pre-commit hook with black #5

merged 7 commits into from
Apr 18, 2024

Conversation

nathaniel-hudson
Copy link
Collaborator

Adds a pre-commit hook for black.

Main Change

There will need to be some user-side configuration. Namely, the following steps:

  1. Install black via pip install black (added to requirements.txt).
  2. Install pre-commit via pip install pre-commit (added to requirements.txt).
  3. Run pre-commit install to setup the pre-commit hooks.

Once these steps are done, you just need to add files to be committed and pushed and the hook will reformat any Python file that does not meet Black's expectations and remove them from the commit. Just re-commit the changes and it'll be added to the commit before pushing.

Other Change(s)

I separated out the Cuda requirements into a separate requirements file (namely, requirements-cuda.txt). This is just for those that might need to install the library for for basic tests on a device that is not Cuda-enabled.

@msakarvadia
Copy link
Owner

@nathaniel-hudson Any chance you could put the steps from this PR in the main README as well?

@nathaniel-hudson
Copy link
Collaborator Author

@msakarvadia, just added instructions to the README.

@msakarvadia msakarvadia merged commit ae6333d into main Apr 18, 2024
@nathaniel-hudson nathaniel-hudson deleted the black-hook branch April 18, 2024 14:52
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