Skip to content

Commit

Permalink
chore: add basic readme
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLucqs committed Aug 6, 2024
1 parent bd1aabd commit 627d75b
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<div align="center">
<h1>
Unretardify
<br>

![SN_Ver_0.12.2](https://img.shields.io/badge/Starknet-0.12.2-0C0C4C.svg?labelColor=282d33&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNTgiIGhlaWdodD0iMTU5IiBmaWxsPSJub25lIiB4bWxuczp2PSJodHRwczovL3ZlY3RhLmlvL25hbm8iPjxnIGZpbGwtcnVsZT0iZXZlbm9kZCI+PHBhdGggZD0iTTAgNzkuOTk2YzAgNDMuNjMxIDM1LjM2OSA3OC45OTkgNzguOTk5IDc4Ljk5OVMxNTggMTIzLjYyNyAxNTggNzkuOTk2IDEyMi42MjkuOTk4IDc4Ljk5OS45OTggMCAzNi4zNjYgMCA3OS45OTZ6IiBmaWxsPSIjMGMwYzRmIi8+PHBhdGggZD0iTTQ0LjE1NCA2MS4zODVsMS45NS02LjAyNWMuMzk2LTEuMjI1IDEuMzYzLTIuMTc5IDIuNTkzLTIuNTU1bDYuMDU0LTEuODYyYS45LjkgMCAwIDAgLjAxNC0xLjcwOGwtNi4wMjctMS45NWMtMS4yMjMtLjM5Ni0yLjE3Ny0xLjM2NC0yLjU1NS0yLjU5M2wtMS44Ni02LjA1NGEuOS45IDAgMCAwLTEuNzA4LS4wMTFsLTEuOTUgNi4wMjVjLS4zOTYgMS4yMjMtMS4zNjQgMi4xNzctMi41OTMgMi41NTVsLTYuMDU0IDEuODZjLS44MzguMjU4LS44NDcgMS40MzgtLjAxNCAxLjcwOGw2LjAyNyAxLjk1YTMuOTUgMy45NSAwIDAgMSAyLjU1NSAyLjU5NmwxLjg2IDYuMDUyYS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jI5LTQuNDc0IDUuNTAyLS40MDcgMTEuODU0LjM0NSAxOC44MyAxLjkxM3oiIGZpbGw9IiNmYWZhZmEiLz48cGF0aCBkPSJNMTEwLjA4MSAxMTQuMDk1YzAgNC45NjkgNC4wMzEgOSA5IDlhOSA5IDAgMSAwIDAtMThjLTQuOTY5IDAtOSA0LjAzLTkgOXoiIGZpbGw9InVybCgjQikiLz48L2c+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJBIiB4MT0iMTM5LjE3NiIgeTE9IjU1LjUwNSIgeDI9IjI4LjUiIHkyPSIxMTciIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBzdG9wLWNvbG9yPSIjZWM3OTZiIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZTE3NWIxIi8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgaWQ9IkIiIHgxPSIxMjguMDciIHkxPSIxMDcuNzgxIiB4Mj0iMTEwLjA2OSIgeTI9IjEwOS42ODUiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBzdG9wLWNvbG9yPSIjZWM3OTZiIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZTE3NWIxIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+)
[![Check Workflow Status](https://github.com/keep-starknet-strange/snos/actions/workflows/check.yml/badge.svg)](https://github.com/keep-starknet-strange/snos/actions/workflows/check.yml)

[![Exploration_Team](https://img.shields.io/badge/Exploration_Team-29296E.svg?&style=for-the-badge&logo=data:image/svg%2bxml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJhIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxODEgMTgxIj48ZGVmcz48c3R5bGU+LmJ7ZmlsbD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SwuMy00Ljc5LDEuNjhsLTEyLjk1LDEzLjg2Yy0uNzYsLjg1LTEuNDUsMS43Ni0yLjA3LDIuNzJoLS42NWMxLjMtNS4zMSwyLjcyLTEwLjYyLDQuMDEtMTUuOGwxLjY4LTYuNzNjLjg0LTIuMTgsLjE1LTQuNjUtMS42OC02LjA5bC0xMi45NS0xNC4xMmMtLjY0LS40NS0xLjE0LTEuMDgtMS40Mi0xLjgxbDE5LjA0LDUuMTgsMi41OSwuNzhjMi4wNCwuNzYsNC4zMywuMTQsNS43LTEuNTVsMTIuOTUtMTQuMzhzLjc4LTEuMDQsMS42OC0xLjE3Yy0xLjgxLDYuNi0yLjk4LDE0LjEyLTUuNDQsMjAuNDYtMS4wOCwyLjk2LS4wOCw2LjI4LDIuNDYsOC4xNiw0LjI3LDQuMTQsOC4yOSw4LjU1LDEyLjk1LDEyLjk1LDAsMCwxLjMsLjkxLDEuNDIsMi4wN2wtMTMuMzQtMy42M1oiLz48L3N2Zz4=)](https://github.com/keep-starknet-strange)

</h1>
</div>

A collection of lints to catch common mistakes and improve your [Cairo](https://github.com/starkware-libs/cairo) code.

## Usage

Unretardify can either be used as a library or as a standalone binary. It can either just detect or fix the detected
problems.

## Contributing

To run the tests you'll need to provide the path to the cairo corelib (at some point this should be automated but we're
not there yet).

```sh
CORELIB_PATH="/path/to/corelibe" cargo test
```

Each lint should have its own tests and should be extensive. To create a new test for a lint you need to create a file
in the [test_files folder](./crates/unretardify-core/tests/test_files/) and should be named as your lint. The file
should have this format:

```txt
//! > Test name
//! > cairo_code
fn main() {
let a: Option<felt252> = Option::Some(1);
}
```

Then in the [test file](crates/unretardify-core/tests/tests.rs) declare your lint like so:

```rs
test_file!(if_let, "simple if let", "simple if let with scope");
```

The first argument is the lint name (also the file name) and the other ones are the test names. After that you can run

```
FIX_TESTS=1 cargo test -p unretardify-core <name_of_lint>
```

This will generate the expected values in your test file. Make sure it is correct.

0 comments on commit 627d75b

Please sign in to comment.