Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor repository docs #158

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 0 additions & 187 deletions .all-contributorsrc

This file was deleted.

1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @software-mansion/cairo-lint
47 changes: 47 additions & 0 deletions .github/ISSUE_TEPLATE/bug_report.yml
wawel37 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Bug Report
description: Create a report to help us improve
labels: ["bug"]
body:
- type: markdown
attributes:
value: Thanks for filing a 🐛 bug report 😄!
- type: textarea
id: problem
attributes:
label: Problem
description: >
Please provide a clear and concise description of what the bug is,
including what currently happens and what you expected to happen.
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps
description: Please list the steps to reproduce the bug.
placeholder: |
1.
2.
3.
- type: textarea
id: scarb-version
attributes:
label: Scarb Version
description: >
Please paste the output of running `scarb --version`.
Remember to do this in the affected project directory.
render: text
validations:
required: true
- type: textarea
id: possible-solutions
attributes:
label: Possible Solution(s)
description: >
Not obligatory, but suggest a fix/reason for the bug,
or ideas how to implement the addition or change.
- type: textarea
id: notes
attributes:
label: Notes
description: Provide any additional notes that might be helpful.
4 changes: 4 additions & 0 deletions .github/ISSUE_TEPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contact_links:
- name: Cairo Linter Telegram Channel
url: https://t.me/cairolint
about: Have a question or issue? Chat with the community and developers here.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Feature Request
description: Suggest an idea for enhancing Cairo language linter.
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for filing a 🙋 feature request! 😄

In case of a relatively big feature that needs feedback from the community, [the cairo-lint Telegram channel][tg] is the best fit.

[tg]: https://t.me/cairolint
- type: textarea
id: problem
attributes:
label: Problem
description: >
Please provide a clear description of your use case and the problem
this feature request is trying to solve.
validations:
required: true
- type: textarea
id: solution
attributes:
label: Proposed Solution
description: >
Please provide a clear and concise description of what you want to happen.
- type: textarea
id: notes
attributes:
label: Notes
description: Provide any additional context or information that might be helpful.
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
groups:
cairo:
patterns:
- "cairo-lang-*"
non critical:
patterns:
- "*"
exclude-patterns:
- "cairo-lang-*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
64 changes: 64 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Contribution Guideline


## Environment setup

- Install the latest Rust via [rustup](https://doc.rust-lang.org/cargo/getting-started/installation.html).
- Install the latest [Scarb via ASDF](https://docs.swmansion.com/scarb/download.html#install-via-asdf).

## Contributing

- Before you open a pull request, it is always a good idea to search the issues and verify if the feature you would like
to add hasn't been already discussed.
- We also appreciate creating a feature request before making a contribution, so it can be discussed before you get to
work.
- If the change you are introducing is changing or breaking the behavior of any already existing features, make sure to
include that information in the pull request description.

## Testing

### Running tests

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/corelib/src" cargo test
```

### CLI instructions

To add a new test you can use the dev cli with:

```
cargo run --bin create_test <lint_name>
```

### Manual instructions

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/cairo-lint-core/tests/test_files/) and should be named as your lint. The file should
have this format:

```rust
//! > Test name

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

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

```rust
test_file!(if_let, "Test name");
```

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 cairo-lint-core <name_of_lint>
```

This will generate the expected values in your test file. Make sure it is correct.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ members = [
version = "0.1.0"
edition = "2021"
repository = "https://github.com/keep-starknet-strange/cairo-lint"
license = "Apache-2.0"
license-file = "LICENSE"

[workspace.dependencies]
Expand Down
Loading
Loading