Precommit hooks make it easier to follow black, pylint, and isort checks as they are run whenever a developer tries to commit changes. This eliminates the back-and-forth with the CI failing because of an accidental extra blank space or missed docstrings. Saves developer time, since they can fix the issue immediately, and saves CI time, since we won't have to have "I forgot black" commits to the PR.
Description of the Change:
Adds a .pre-commit-config.yaml similar to the one in pennylane. At this current point, it only runs checks on the frontend, but I'd be happy to extend it to other parts of the code base too.
pre-commit hooks are opt in, with the developer needing to have precommit installed and run pre-commit install on the repository. They can also be bypassed by including --no-verify when trying to commit.
Context:
Precommit hooks make it easier to follow black, pylint, and isort checks as they are run whenever a developer tries to commit changes. This eliminates the back-and-forth with the CI failing because of an accidental extra blank space or missed docstrings. Saves developer time, since they can fix the issue immediately, and saves CI time, since we won't have to have "I forgot black" commits to the PR.
Description of the Change:
Adds a
.pre-commit-config.yaml
similar to the one in pennylane. At this current point, it only runs checks on thefrontend
, but I'd be happy to extend it to other parts of the code base too.pre-commit hooks are opt in, with the developer needing to have precommit installed and run
pre-commit install
on the repository. They can also be bypassed by including--no-verify
when trying to commit.Benefits:
Fewer failing CI runs due to formatting issues.
Possible Drawbacks:
Related GitHub Issues: