Enhance your Cairo development workflow with the pre-commit toolset.
- Begin by installing pre-commit using pip (refer to pre-commit documentation if needed).
pip install pre-commit
-
Create a
.pre-commit-config.yaml
file in the root of your project. -
Populate your pre-commit configuration with the desired hooks:
repos:
- repo: https://github.com/dubzn/pre-commit-cairo.git
rev: v0.1.4
hooks:
- id: scarb-fmt
args: [--check] # This argument is optional, you can remove '--check' to apply scarb fmt directly
- id: scarb-test
args: []
# include other hooks
Note: The available hooks for version v0.1.4
are:
# Scarb
# Format code using Scarb.
- id: scarb-fmt
# Run Scarb tests to ensure the reliability of the Cairo project.
- id: scarb-test
# Use Scarb to execute the build process for the Cairo project.
- id: scarb-build
# Foundry
# Run Foundry tests to ensure the reliability of the Cairo project.
- id: foundry-test
- Install pre-commit config.
pre-commit install
- Enjoy the streamlined development process! 🎉