Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
feat(pre commit): add precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLucqs committed Aug 3, 2022
1 parent dae66a5 commit a0732db
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ This project can be made better and will evolve as StarkNet matures. Your contri
- Add an explanation in the comments of the exercise if you feel it needs more explanation
- Add exercises showcasing your favorite Cairo feature

​Before contributing run this

```bash
ln -s ../../pre-commit.sh .git/hooks/pre-commit
```


## Getting ready to work
Expand Down
13 changes: 13 additions & 0 deletions pre-commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
echo "Linting the markdown files"
for md_file in $(find ./ -type f -name "*.md"); do
npx markdownlint-cli2-fix $md_file
done

echo "compiling and formating the cairo files"
for cairo_file in $(find contracts/ -type f -name "*.cairo"); do
echo $cairo_file
starknet-compile $cairo_file >/dev/null
cairo-format -i $cairo_file
done
echo "done"

0 comments on commit a0732db

Please sign in to comment.