Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzn committed Jan 8, 2024
1 parent 713c4ac commit 679ae0f
Showing 1 changed file with 49 additions and 19 deletions.
68 changes: 49 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,59 @@
# Cairo hooks for pre-commit
# Pre-commit Hooks for Cairo

[Cairo](https://www.cairo-lang.org/) tools package for [pre-commit](https://pre-commit.com).
Enhance your [Cairo](https://www.cairo-lang.org/) development workflow with the [pre-commit](https://pre-commit.com) toolset.

## Using cairo tools with pre-commit
1. Install pre-commit with pip (or check [pre-commit](https://pre-commit.com/#install) docs).
## Integrating Cairo Tools with pre-commit
1. Begin by installing pre-commit using pip (refer to [pre-commit documentation](https://pre-commit.com/#install) if needed).
```sh
pip install pre-commit
```

2. Create a `.pre-commit-config.yaml` file in the root of your project.

2. Create a .pre-commit-config.yaml in your root project
3. Populate your pre-commit configuration with the desired hooks:
```yaml
repos:
- repo: https://github.com/dubzn/pre-commit-cairo.git
rev: v0.1.3
hooks:
- id: scarb-fmt
args: [--check]
- id: scarb-test
args: []
# include other hooks
```

3. Add the hooks that you want in your pre-commit configuration
*Note: The available hooks for version `v0.1.3` are:*
```yaml
- repo: https://github.com/dubzn/pre-commit-cairo
rev: v0.1.0
hooks:
- id: scarb-fmt
- id: scarb-build
- id: scarb-clean
- id: scarb-test

- id: foundry-test
# Scarb

# Run Scarb tests to ensure the reliability of the Cairo project.
- 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

# Run the Scarb clean command to remove temporary files in the Cairo project.
- id: scarb-clean

# Foundry

# Run Foundry tests to ensure the reliability of the Cairo project.
- id: foundry-test
```
4. Install pre-commit config.
```sh
pre-commit install
```

4. Execute pre-commit install
5. Enjoy the streamlined development process! 🎉

5. Enjoy!
---

⚠️ This repository uses
### Make sure you have the dependencies installed according to your project:
- [Scarb](https://docs.swmansion.com/scarb/)
- [Foundry](https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html)
- [Foundry](https://foundry-rs.github.io/starknet-foundry/getting-started/installation.html)

0 comments on commit 679ae0f

Please sign in to comment.