From 679ae0f94664058149cb8c4662d6edd2a76abbf9 Mon Sep 17 00:00:00 2001 From: dubzn Date: Mon, 8 Jan 2024 10:23:52 -0300 Subject: [PATCH] update readme --- README.md | 68 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index f65ab73..92c2710 100644 --- a/README.md +++ b/README.md @@ -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) \ No newline at end of file