facebookresearch / labgraph

LabGraph is a Python framework for rapidly prototyping experimental systems for real-time streaming applications. It is particularly well-suited to real-time neuroscience, physiology and psychology experiments.
MIT License
162 stars 47 forks source link

pre-commit hook for black and flake8 #76

Closed dtemir closed 4 months ago

dtemir commented 2 years ago

Description

I think it would be a good idea to standardize the code contributed to LabGraph by having contributors use pre-commit hook that will automatically run black and flake8 when the user makes a commit.

That way as users keep committing changes, the new code will automatically follow good standards.

Fixes #74

Type of change

Please delete options that are not relevant.

Checklist:

dtemir commented 2 years ago

@jfResearchEng please let me know if that'd be a useful change, but feel free to close the PR if you think it's unnecessary.

dtemir commented 2 years ago

One more idea: If this would be useful, I think it would be a good idea to run this

Install pre-commit:

pip install pre-commit

Install the git hooks script:

pre-commit install

It uses a file called .pre-commit-config.yaml to create a Git hook .git/hooks/pre-commit

Apply the hook to all files: https://pre-commit.com/#4-optional-run-against-all-the-files

pre-commit run --all-files

To level everything up first